Differences From Artifact [456aec5d03]:
- File
src/OFHTTPRequest.m
— part of check-in
[d5ddb2cb48]
at
2012-06-06 13:09:08
on branch trunk
— Rework OFDataArray API.
Also adds more checks. (user: js, size: 12261) [annotate] [blame] [check-ins using] [more...]
To Artifact [bba59f52c5]:
- File src/OFHTTPRequest.m — part of check-in [0d4059306a] at 2012-06-07 12:03:10 on branch trunk — Rework OFStream API. (user: js, size: 12275) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
224 225 226 227 228 229 230 | [sock connectToHost: [URL host] port: [URL port]]; /* * Work around a bug with packet bisection in lighttpd when using * HTTPS. */ | | | 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | [sock connectToHost: [URL host] port: [URL port]]; /* * Work around a bug with packet bisection in lighttpd when using * HTTPS. */ [sock setWriteBufferEnabled: YES]; if (requestType == OF_HTTP_REQUEST_TYPE_GET) type = "GET"; if (requestType == OF_HTTP_REQUEST_TYPE_HEAD) type = "HEAD"; if (requestType == OF_HTTP_REQUEST_TYPE_POST) type = "POST"; |
| ︙ | ︙ | |||
270 271 272 273 274 275 276 | [queryString UTF8StringLength]]; } [sock writeString: @"\r\n"]; /* Work around a bug in lighttpd, see above */ [sock flushWriteBuffer]; | | | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
[queryString UTF8StringLength]];
}
[sock writeString: @"\r\n"];
/* Work around a bug in lighttpd, see above */
[sock flushWriteBuffer];
[sock setWriteBufferEnabled: NO];
if (requestType == OF_HTTP_REQUEST_TYPE_POST)
[sock writeString: queryString];
@try {
line = [sock readLine];
} @catch (OFInvalidEncodingException *e) {
|
| ︙ | ︙ | |||
418 419 420 421 422 423 424 |
contentLength >= bytesReceived))
break;
while (toRead > 0) {
size_t length = (toRead < of_pagesize
? toRead : of_pagesize);
| | | | 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
contentLength >= bytesReceived))
break;
while (toRead > 0) {
size_t length = (toRead < of_pagesize
? toRead : of_pagesize);
length = [sock readIntoBuffer: buffer
length: length];
[delegate request: self
didReceiveData: buffer
withLength: length];
[pool2 releaseObjects];
bytesReceived += length;
|
| ︙ | ︙ | |||
449 450 451 452 453 454 455 |
exceptionWithClass: isa];
[pool2 releaseObjects];
}
} else {
size_t length;
| | | > | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
exceptionWithClass: isa];
[pool2 releaseObjects];
}
} else {
size_t length;
while ((length = [sock
readIntoBuffer: buffer
length: of_pagesize]) > 0) {
[delegate request: self
didReceiveData: buffer
withLength: length];
[pool2 releaseObjects];
bytesReceived += length;
[data addItemsFromCArray: buffer
|
| ︙ | ︙ |