From cf1cfca51ff6528f5aca9308f0b95808762c2b4e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 1 Mar 2013 00:05:57 +0900 Subject: [PATCH] shrpx: Fix not send RST_STREAM when downstream gets valid EOF --- src/shrpx_spdy_upstream.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index ad60228..f41d636 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -564,8 +564,10 @@ void spdy_downstream_eventcb(bufferevent *bev, short events, void *ptr) // RST_STREAM is sent after all pending data are sent. upstream->on_downstream_body_complete(downstream); } else if(downstream->get_response_state() == Downstream::MSG_COMPLETE) { - // For SSL tunneling? - upstream->rst_stream(downstream, SPDYLAY_INTERNAL_ERROR); + if(downstream->tunnel_established()) { + // For SSL tunneling + upstream->rst_stream(downstream, SPDYLAY_INTERNAL_ERROR); + } } else { // If stream was not closed, then we set MSG_COMPLETE and let // on_stream_close_callback delete downstream.