ObjFW  Check-in [0d804ed391]

Overview
Comment:Fix -[OFHTTPClientResponse isAtEndOfStream]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 1.0
Files: files | file ages | folders
SHA3-256: 0d804ed391798af1ea425255022d0f5b5858cf5b1a5a6d08d40f9ca22b1805b8
User & Date: js on 2024-03-04 00:43:52
Other Links: branch diff | manifest | tags
Context
2024-03-04
01:07
Fix -[OFGZIPStream isAtEndOfStream] check-in: d1e7172eff user: js tags: 1.0
00:43
Fix -[OFHTTPClientResponse isAtEndOfStream] check-in: 0d804ed391 user: js tags: 1.0
00:43
Fix -[OFHTTPClientResponse isAtEndOfStream] check-in: 3ef01bd2d5 user: js tags: trunk
2024-03-03
23:35
OFFileIRIHandler: Correctly transform exception check-in: 1829139db1 user: js tags: 1.0
Changes

Modified src/OFHTTPClient.m from [f4e46fad30] to [144f6b972c].

914
915
916
917
918
919
920



921
922
923
924
925
926
927
928
929
930
931
932
933
}

- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length
{
	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];




	if (_atEndOfStream)
		return 0;

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

	if (_stream.atEndOfStream)
		@throw [OFTruncatedDataException exception];

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








>
>
>



<
<
<







914
915
916
917
918
919
920
921
922
923
924
925
926



927
928
929
930
931
932
933
}

- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length
{
	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

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

	if (_atEndOfStream)
		return 0;




	if (_stream.atEndOfStream)
		@throw [OFTruncatedDataException exception];

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

1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059

		return 0;
	}
}

- (bool)lowlevelIsAtEndOfStream
{
	if (_atEndOfStream)
		return true;

	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (!_hasContentLength && !_chunked)
		return _stream.atEndOfStream;

	return _atEndOfStream;







<
<
<







1043
1044
1045
1046
1047
1048
1049



1050
1051
1052
1053
1054
1055
1056

		return 0;
	}
}

- (bool)lowlevelIsAtEndOfStream
{



	if (_stream == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (!_hasContentLength && !_chunked)
		return _stream.atEndOfStream;

	return _atEndOfStream;