Differences From Artifact [c6a81ba86b]:
- File
src/OFHTTPClient.m
— part of check-in
[f218986f51]
at
2018-12-18 14:14:25
on branch trunk
— Use OFData instead of a buffer for async writes
This avoids the entire problem of keeping the buffer alive until the
write finished. (user: js, size: 29505) [annotate] [blame] [check-ins using]
To Artifact [4b4df1c5de]:
- File src/OFHTTPClient.m — part of check-in [6b35b78f94] at 2018-12-18 16:41:11 on branch trunk — Add -[OFStream asyncWriteString:] (user: js, size: 29384) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
552 553 554 555 556 557 558 | ret = false; } return ret; } - (OFData *)stream: (OF_KINDOF(OFStream *))stream | | > | 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 |
ret = false;
}
return ret;
}
- (OFData *)stream: (OF_KINDOF(OFStream *))stream
didWriteString: (OFString *)string
encoding: (of_string_encoding_t)encoding
bytesWritten: (size_t)bytesWritten
exception: (id)exception
{
if (exception != nil) {
if ([exception isKindOfClass: [OFWriteFailedException class]] &&
([exception errNo] == ECONNRESET ||
[exception errNo] == EPIPE)) {
|
| ︙ | ︙ | |||
603 604 605 606 607 608 609 |
* send it all at once.
*
* We do not use the socket's write buffer in case we need to resend
* the entire request (e.g. in case a keep-alive connection timed out).
*/
@try {
| | < < < < < | 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 |
* send it all at once.
*
* We do not use the socket's write buffer in case we need to resend
* the entire request (e.g. in case a keep-alive connection timed out).
*/
@try {
[sock asyncWriteString: constructRequestString(_request)];
} @catch (id e) {
[self raiseException: e];
return;
}
}
- (void)socket: (OF_KINDOF(OFTCPSocket *))sock
|
| ︙ | ︙ |