ObjFW  Check-in [fea4fe86b0]

Overview
Comment:OFHTTPClient: Fixes for chunked request bodies
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fea4fe86b01626fd1802d70110f1860a0c23437ec0ddb154cfc9395f3ba6a69c
User & Date: js on 2020-03-28 14:35:44
Other Links: manifest | tags
Context
2020-03-29
03:05
OFHTTPClient: Minor chunked body improvement check-in: d9350dba53 user: js tags: trunk
2020-03-28
14:35
OFHTTPClient: Fixes for chunked request bodies check-in: fea4fe86b0 user: js tags: trunk
14:35
OFHTTPServer: Support for chunked request bodies check-in: 8faade8d19 user: js tags: trunk
Changes

Modified src/OFHTTPClient.m from [f598209a86] to [515705e71c].

781
782
783
784
785
786
787


788
789
790
791
792
793
794
...
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
	if (_chunked)
		[_socket writeFormat: @"%zX\r\n", length];
	else if (length > _toWrite)
		length = (size_t)_toWrite;

	ret = [_socket writeBuffer: buffer
			    length: length];



	if (ret > length)
		@throw [OFOutOfRangeException exception];

	if (!_chunked) {
		_toWrite -= ret;

................................................................................

- (void)close
{
	if (_socket == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_chunked)
		[_socket writeString: @"0\r\n"];
	else if (_toWrite > 0)
		@throw [OFTruncatedDataException exception];

	_socket.delegate = _handler;
	[_socket asyncReadLine];

	[_socket release];







>
>







 







|







781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
...
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
	if (_chunked)
		[_socket writeFormat: @"%zX\r\n", length];
	else if (length > _toWrite)
		length = (size_t)_toWrite;

	ret = [_socket writeBuffer: buffer
			    length: length];
	if (_chunked)
		[_socket writeString: @"\r\n"];

	if (ret > length)
		@throw [OFOutOfRangeException exception];

	if (!_chunked) {
		_toWrite -= ret;

................................................................................

- (void)close
{
	if (_socket == nil)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_chunked)
		[_socket writeString: @"0\r\n\r\n"];
	else if (_toWrite > 0)
		@throw [OFTruncatedDataException exception];

	_socket.delegate = _handler;
	[_socket asyncReadLine];

	[_socket release];