Commit aa64e7ad authored by Jacob Champion's avatar Jacob Champion

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.
parent edb874e6
...@@ -1708,6 +1708,12 @@ void check_response_header(nghttp2_session *session, Request *req) { ...@@ -1708,6 +1708,12 @@ void check_response_header(nghttp2_session *session, Request *req) {
req->res_nva.clear(); req->res_nva.clear();
http2::init_hdidx(req->res_hdidx); http2::init_hdidx(req->res_hdidx);
return; 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) { if (gzip) {
...@@ -2044,6 +2050,12 @@ int on_stream_close_callback(nghttp2_session *session, int32_t stream_id, ...@@ -2044,6 +2050,12 @@ int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
return 0; 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); update_html_parser(client, req, nullptr, 0, 1);
++client->complete; ++client->complete;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment