Differences From Artifact [a21896a236]:
- File src/OFHTTPRequest.m — part of check-in [a3e03981ea] at 2011-02-10 17:19:23 on branch trunk — Use ports instead of services in OFTCPSocket. (user: js, size: 6044) [annotate] [blame] [check-ins using]
To Artifact [5c79012c43]:
- File
src/OFHTTPRequest.m
— part of check-in
[c64d88f50f]
at
2011-02-24 18:27:59
on branch trunk
— Make it possible to specify a TLS socket class for OFHTTPRequest.
This way, OFHTTPRequest will support HTTPS using a third party TLS
library. (user: js, size: 6401) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #import "OFString.h" #import "OFURL.h" #import "OFTCPSocket.h" #import "OFDictionary.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" @implementation OFHTTPRequest + request { return [[[self alloc] init] autorelease]; } - init | > > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #import "OFString.h" #import "OFURL.h" #import "OFTCPSocket.h" #import "OFDictionary.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" Class of_http_request_tls_socket_class = Nil; @implementation OFHTTPRequest + request { return [[[self alloc] init] autorelease]; } - init |
︙ | ︙ | |||
103 104 105 106 107 108 109 | - (OFHTTPRequestResult*)result { return [self resultWithRedirects: 10]; } - (OFHTTPRequestResult*)resultWithRedirects: (size_t)redirects { | | > | | > | > > > > > > > > > | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - (OFHTTPRequestResult*)result { return [self resultWithRedirects: 10]; } - (OFHTTPRequestResult*)resultWithRedirects: (size_t)redirects { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *scheme = [URL scheme]; OFTCPSocket *sock; OFHTTPRequestResult *result; if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"]) @throw [OFUnsupportedProtocolException newWithClass: isa URL: URL]; if ([scheme isEqual: @"http"]) sock = [OFTCPSocket socket]; else { if (of_http_request_tls_socket_class == Nil) @throw [OFUnsupportedProtocolException newWithClass: isa URL: URL]; sock = [[[of_http_request_tls_socket_class alloc] init] autorelease]; } [sock connectToHost: [URL host] onPort: [URL port]]; @try { OFString *line; OFMutableDictionary *s_headers; |
︙ | ︙ |