ObjFW  Check-in [69c2ca803a]

Overview
Comment:OFHTTPClient: Throw if socket got closed too early
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 69c2ca803aae66a39ffa876bf39c7a32c2c9501a4114b5ae6812fdbf17cdb480
User & Date: js on 2018-03-11 23:11:37
Other Links: manifest | tags
Context
2018-03-13
23:05
Treat the leading slash of a path as a component check-in: a7ce7bb441 user: js tags: trunk
2018-03-11
23:11
OFHTTPClient: Throw if socket got closed too early check-in: 69c2ca803a user: js tags: trunk
21:59
Clean up -[OFURL initFileURLWithPath:isDirectory:] check-in: 88d0ccf804 user: js tags: trunk
Changes

Modified src/OFHTTPClient.m from [b38762c50f] to [e9e028700b].

928
929
930
931
932
933
934



935
936
937
938
939
940
941
	if (_atEndOfStream)
		return 0;

	if (!_hasContentLength && !_chunked)
		return [_socket readIntoBuffer: buffer
					length: length];




	/* Content-Length */
	if (!_chunked) {
		size_t ret;

		if (length > _toRead)
			length = (size_t)_toRead;








>
>
>







928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
	if (_atEndOfStream)
		return 0;

	if (!_hasContentLength && !_chunked)
		return [_socket readIntoBuffer: buffer
					length: length];

	if ([_socket isAtEndOfStream])
		@throw [OFTruncatedDataException exception];

	/* Content-Length */
	if (!_chunked) {
		size_t ret;

		if (length > _toRead)
			length = (size_t)_toRead;