ObjFW  Diff

Differences From Artifact [d31701c86f]:

To Artifact [85a479fa56]:


311
312
313
314
315
316
317
318

319
320
321
322
323
324
325
326
311
312
313
314
315
316
317

318

319
320
321
322
323
324
325







-
+
-







	response.protocolVersionString = _version;
	response.statusCode = _status;
	response.headers = _serverHeaders;

	connectionHeader = [_serverHeaders objectForKey: @"Connection"];
	if ([_version isEqual: @"1.1"]) {
		if (connectionHeader != nil)
			keepAlive = ([connectionHeader caseInsensitiveCompare:
			keepAlive = [connectionHeader isEqual: @"close"];
			    @"close"] != OF_ORDERED_SAME);
		else
			keepAlive = true;
	} else {
		if (connectionHeader != nil)
			keepAlive = ([connectionHeader caseInsensitiveCompare:
			    @"keep-alive"] == OF_ORDERED_SAME);
		else
691
692
693
694
695
696
697
698


699
700
701
702
703
704
705
690
691
692
693
694
695
696

697
698
699
700
701
702
703
704
705







-
+
+







		OFURL *URL = _request.URL;
		OFTCPSocket *sock;
		uint16_t port;
		OFNumber *URLPort;

		[_client close];

		if ([URL.scheme isEqual: @"https"]) {
		if ([URL.scheme caseInsensitiveCompare: @"https"] ==
		    OF_ORDERED_SAME) {
			if (of_tls_socket_class == Nil)
				@throw [OFUnsupportedProtocolException
				    exceptionWithURL: URL];

			sock = [[[of_tls_socket_class alloc] init] autorelease];
			port = 443;
		} else {
1243
1244
1245
1246
1247
1248
1249

1250

1251
1252
1253
1254
1255
1256
1257
1243
1244
1245
1246
1247
1248
1249
1250

1251
1252
1253
1254
1255
1256
1257
1258







+
-
+







- (void)asyncPerformRequest: (OFHTTPRequest *)request
		  redirects: (unsigned int)redirects
{
	void *pool = objc_autoreleasePoolPush();
	OFURL *URL = request.URL;
	OFString *scheme = URL.scheme;

	if ([scheme caseInsensitiveCompare: @"http"] != OF_ORDERED_SAME &&
	if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"])
	    [scheme caseInsensitiveCompare: @"https"] != OF_ORDERED_SAME)
		@throw [OFUnsupportedProtocolException exceptionWithURL: URL];

	if (_inProgress)
		/* TODO: Find a better exception */
		@throw [OFAlreadyConnectedException exception];

	_inProgress = true;