311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
response.protocolVersionString = _version;
response.statusCode = _status;
response.headers = _serverHeaders;
connectionHeader = [_serverHeaders objectForKey: @"Connection"];
if ([_version isEqual: @"1.1"]) {
if (connectionHeader != nil)
keepAlive = ([connectionHeader caseInsensitiveCompare:
@"close"] != OF_ORDERED_SAME);
else
keepAlive = true;
} else {
if (connectionHeader != nil)
keepAlive = ([connectionHeader caseInsensitiveCompare:
@"keep-alive"] == OF_ORDERED_SAME);
else
|
|
<
|
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 isEqual: @"close"];
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
|
OFURL *URL = _request.URL;
OFTCPSocket *sock;
uint16_t port;
OFNumber *URLPort;
[_client close];
if ([URL.scheme isEqual: @"https"]) {
if (of_tls_socket_class == Nil)
@throw [OFUnsupportedProtocolException
exceptionWithURL: URL];
sock = [[[of_tls_socket_class alloc] init] autorelease];
port = 443;
} else {
|
|
>
|
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 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
|
- (void)asyncPerformRequest: (OFHTTPRequest *)request
redirects: (unsigned int)redirects
{
void *pool = objc_autoreleasePoolPush();
OFURL *URL = request.URL;
OFString *scheme = URL.scheme;
if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"])
@throw [OFUnsupportedProtocolException exceptionWithURL: URL];
if (_inProgress)
/* TODO: Find a better exception */
@throw [OFAlreadyConnectedException exception];
_inProgress = true;
|
>
|
|
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 &&
[scheme caseInsensitiveCompare: @"https"] != OF_ORDERED_SAME)
@throw [OFUnsupportedProtocolException exceptionWithURL: URL];
if (_inProgress)
/* TODO: Find a better exception */
@throw [OFAlreadyConnectedException exception];
_inProgress = true;
|