ObjFW  Check-in [8066257442]

Overview
Comment:OFHTTPClient: Minor change to improve readability
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 806625744240c74c0c1e2f2159a108bf33b4866aaaadbc45b8d99eb147be4b11
User & Date: js on 2017-05-07 15:01:32
Other Links: manifest | tags
Context
2017-05-07
15:39
Do not include any addresses in -[description] check-in: 7c2a0dda3d user: js tags: trunk
15:01
OFHTTPClient: Minor change to improve readability check-in: 8066257442 user: js tags: trunk
2017-05-06
22:10
OFString: Add missing #ifdef check-in: 32e47a0f36 user: js tags: trunk
Changes

Modified src/OFHTTPClient.m from [fdea43ced0] to [f34d4593a1].

371
372
373
374
375
376
377



378
379
380
381
382
383
384
385
386
387
388

389
390
391
392

393
394
395

396
397
398
399
400
401
402
	} else
		socket = [self OF_closeAndCreateSocketForRequest: request];

	/*
	 * As a work around for a bug with split packets in lighttpd when using
	 * HTTPS, we construct the complete request in a buffer string and then
	 * send it all at once.



	 */

	path = [URL path];

	if (path == nil)
		path = @"/";

	if ([URL query] != nil)
		requestString = [OFMutableString stringWithFormat:
		    @"%s %@?%@ HTTP/%@\r\n",
		    of_http_request_method_to_string(method), path,

		    [[URL query] stringByURLEncoding],
		    [request protocolVersionString]];
	else
		requestString = [OFMutableString stringWithFormat:

		    @"%s %@ HTTP/%@\r\n",
		    of_http_request_method_to_string(method), path,
		    [request protocolVersionString]];


	headers = [[[request headers] mutableCopy] autorelease];
	if (headers == nil)
		headers = [OFMutableDictionary dictionary];

	if ([headers objectForKey: @"Host"] == nil) {
		if (([scheme isEqual: @"http"] && [URL port] != 80) ||







>
>
>



<



<
|
<
|
>
|
|
<
|
>
|
|
|
>







371
372
373
374
375
376
377
378
379
380
381
382
383

384
385
386

387

388
389
390
391

392
393
394
395
396
397
398
399
400
401
402
403
404
	} else
		socket = [self OF_closeAndCreateSocketForRequest: request];

	/*
	 * As a work around for a bug with split packets in lighttpd when using
	 * HTTPS, we construct the complete request in a buffer string and then
	 * send it all at once.
	 *
	 * We do not use the socket's write buffer in case we need to resend
	 * the entire request (e.g. in case a keep-alive connection timed out).
	 */

	path = [URL path];

	if (path == nil)
		path = @"/";


	requestString = [OFMutableString stringWithFormat:

	    @"%s %@", of_http_request_method_to_string(method), path];

	if ([URL query] != nil) {
		[requestString appendString: @"?"];

		[requestString appendString: [URL query]];
	}

	[requestString appendString: @" HTTP/"];
	[requestString appendString: [request protocolVersionString]];
	[requestString appendString: @"\r\n"];

	headers = [[[request headers] mutableCopy] autorelease];
	if (headers == nil)
		headers = [OFMutableDictionary dictionary];

	if ([headers objectForKey: @"Host"] == nil) {
		if (([scheme isEqual: @"http"] && [URL port] != 80) ||