From 734d7bced8d21375ec63b1cd807a9803b352f5f0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 9 Feb 2013 23:20:29 +0900 Subject: [PATCH] shrpx: Handle downstream response_state == MSG_RESET case in SPDY upstream --- src/shrpx_spdy_upstream.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 7b65695..6afcf82 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -448,6 +448,18 @@ void spdy_downstream_readcb(bufferevent *bev, void *ptr) delete downstream; return; } + + if(downstream->get_response_state() == Downstream::MSG_RESET) { + // The downstream stream was reset (canceled). In this case, + // RST_STREAM to the upstream and delete downstream connection + // here. Deleting downstream will be taken place at + // on_stream_close_callback. + upstream->rst_stream(downstream, SPDYLAY_CANCEL); + downstream->set_downstream_connection(0); + delete dconn; + return; + } + int rv = downstream->on_read(); if(rv != 0) { if(LOG_ENABLED(INFO)) {