From 223242b512ac91154bb07cfa310e8785adfe699a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 26 Aug 2014 22:16:19 +0900 Subject: [PATCH] nghttpx: Don't consume response data in downstream on_stream_close_callback Even after on_stream_close_callback, Http2DownstreamConnection is still alive and upstream keeps sending response to the client. The consumed bytes are processed normally (data_source_read_callback) and also we have a code to consume all allocated bytes for Http2DownstreamConnection object when it is deleted. This means that we don't need to and should not consume response data in downstream on_stream_close_callback. If we do, we may get assertion error in Http2DownstreamConnection::resume_read(). --- src/shrpx_http2_session.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index ca8aebfc..5462ce12 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -774,11 +774,6 @@ int on_stream_close_callback auto downstream = dconn->get_downstream(); if(downstream && downstream->get_downstream_stream_id() == stream_id) { - http2session->consume(downstream->get_downstream_stream_id(), - downstream->get_response_datalen()); - - downstream->reset_response_datalen(); - if(downstream->get_upgraded() && downstream->get_response_state() == Downstream::HEADER_COMPLETE) { // For tunneled connection, we have to submit RST_STREAM to