Updating HTTP write loop logic to match FlowTransport. This is a possible bug fix because TLS connections can sometimes hang on startup which might due to onWritable() hanging if write() is not called first.
This commit is contained in:
parent
ae2d158c01
commit
4a246c36ad
|
@ -352,9 +352,6 @@ namespace HTTP {
|
|||
send_start = timer();
|
||||
|
||||
loop {
|
||||
wait(conn->onWritable());
|
||||
wait(yield(TaskPriority::WriteSocket));
|
||||
|
||||
// If we already got a response, before finishing sending the request, then close the connection,
|
||||
// set the Connection header to "close" as a hint to the caller that this connection can't be used
|
||||
// again, and break out of the send loop.
|
||||
|
@ -375,6 +372,9 @@ namespace HTTP {
|
|||
pContent->sent(len);
|
||||
if(pContent->empty())
|
||||
break;
|
||||
|
||||
wait(conn->onWritable());
|
||||
wait(yield(TaskPriority::WriteSocket));
|
||||
}
|
||||
|
||||
wait(responseReading);
|
||||
|
|
Loading…
Reference in New Issue