nghttpx: Detach DownstreamConnection early
This commit is contained in:
parent
5a497b9f30
commit
f1049a66e2
|
@ -898,6 +898,13 @@ int Http2Upstream::downstream_read(DownstreamConnection *dconn) {
|
|||
}
|
||||
return downstream_error(dconn, Downstream::EVENT_ERROR);
|
||||
}
|
||||
// Detach downstream connection early so that it could be reused
|
||||
// without hitting server's request timeout.
|
||||
if (downstream->get_response_state() == Downstream::MSG_COMPLETE &&
|
||||
!downstream->get_response_connection_close()) {
|
||||
// Keep-alive
|
||||
downstream->detach_downstream_connection();
|
||||
}
|
||||
}
|
||||
|
||||
handler_->signal_write();
|
||||
|
|
|
@ -465,6 +465,14 @@ int HttpsUpstream::downstream_read(DownstreamConnection *dconn) {
|
|||
goto end;
|
||||
}
|
||||
|
||||
// Detach downstream connection early so that it could be reused
|
||||
// without hitting server's request timeout.
|
||||
if (downstream->get_response_state() == Downstream::MSG_COMPLETE &&
|
||||
!downstream->get_response_connection_close()) {
|
||||
// Keep-alive
|
||||
downstream->detach_downstream_connection();
|
||||
}
|
||||
|
||||
if (rv == DownstreamConnection::ERR_EOF) {
|
||||
return downstream_eof(dconn);
|
||||
}
|
||||
|
|
|
@ -552,6 +552,13 @@ int SpdyUpstream::downstream_read(DownstreamConnection *dconn) {
|
|||
}
|
||||
return downstream_error(dconn, Downstream::EVENT_ERROR);
|
||||
}
|
||||
// Detach downstream connection early so that it could be reused
|
||||
// without hitting server's request timeout.
|
||||
if (downstream->get_response_state() == Downstream::MSG_COMPLETE &&
|
||||
!downstream->get_response_connection_close()) {
|
||||
// Keep-alive
|
||||
downstream->detach_downstream_connection();
|
||||
}
|
||||
}
|
||||
|
||||
handler_->signal_write();
|
||||
|
|
Loading…
Reference in New Issue