Differences From 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]
To Artifact [af54b95e34]:
- File src/OFHTTPRequest.m — part of check-in [73c723bf39] at 2011-02-25 12:02:38 on branch trunk — OFHTTPRequest: Work around a bug in lighttpd with HTTPS. (user: js, size: 6635) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
126 127 128 129 130 131 132 | newWithClass: isa URL: URL]; sock = [[[of_http_request_tls_socket_class alloc] init] autorelease]; } | < < < > > > > > > > > > | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | newWithClass: isa URL: URL]; sock = [[[of_http_request_tls_socket_class alloc] init] autorelease]; } @try { OFString *line; OFMutableDictionary *s_headers; OFDataArray *data; OFEnumerator *enumerator; OFString *key; int status; const char *t; [sock connectToHost: [URL host] onPort: [URL port]]; /* * Work around a bug with packet bisection in lighttpd when * using HTTPS. */ [sock setBuffersWrites: YES]; if (requestType == OF_HTTP_REQUEST_TYPE_GET) t = "GET"; if (requestType == OF_HTTP_REQUEST_TYPE_HEAD) t = "HEAD"; if (requestType == OF_HTTP_REQUEST_TYPE_POST) t = "POST"; |
︙ | ︙ | |||
175 176 177 178 179 180 181 182 183 184 185 186 187 188 | if ([headers objectForKey: @"Content-Length"] == nil) [sock writeFormat: @"Content-Length: %d\r\n", [queryString cStringLength]]; } [sock writeString: @"\r\n"]; if (requestType == OF_HTTP_REQUEST_TYPE_POST) [sock writeString: queryString]; /* * We also need to check for HTTP/1.1 since Apache always * declares the reply to be HTTP/1.1. | > > > > | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | if ([headers objectForKey: @"Content-Length"] == nil) [sock writeFormat: @"Content-Length: %d\r\n", [queryString cStringLength]]; } [sock writeString: @"\r\n"]; /* Work around a bug in lighttpd, see above */ [sock flushWriteBuffer]; [sock setBuffersWrites: NO]; if (requestType == OF_HTTP_REQUEST_TYPE_POST) [sock writeString: queryString]; /* * We also need to check for HTTP/1.1 since Apache always * declares the reply to be HTTP/1.1. |
︙ | ︙ |