nghttp: stop ContinueTimers on response or reset
If the stream itself is reset, or the server sends a final response immediately, any Expect/Continue handshake should be cancelled.
This commit is contained in:
parent
edb874e659
commit
aa64e7ad3c
|
@ -1708,6 +1708,12 @@ void check_response_header(nghttp2_session *session, Request *req) {
|
|||
req->res_nva.clear();
|
||||
http2::init_hdidx(req->res_hdidx);
|
||||
return;
|
||||
} else {
|
||||
// A final response stops any pending Expect/Continue handshake.
|
||||
std::shared_ptr<ContinueTimer> timer = req->continue_timer.lock();
|
||||
if (timer) {
|
||||
timer->stop();
|
||||
}
|
||||
}
|
||||
|
||||
if (gzip) {
|
||||
|
@ -2044,6 +2050,12 @@ int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
|||
return 0;
|
||||
}
|
||||
|
||||
// If this request is using Expect/Continue, stop its ContinueTimer.
|
||||
std::shared_ptr<ContinueTimer> timer = req->continue_timer.lock();
|
||||
if (timer) {
|
||||
timer->stop();
|
||||
}
|
||||
|
||||
update_html_parser(client, req, nullptr, 0, 1);
|
||||
++client->complete;
|
||||
|
||||
|
|
Loading…
Reference in New Issue