From 4461cb24eda0fdab6d3f3cc3b7a8b7c752607be5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 7 Mar 2013 21:32:10 +0900 Subject: [PATCH] shrpx: Fix assertion failure in SpdyDownstreamConnection::attach_stream_data --- src/shrpx_spdy_downstream_connection.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shrpx_spdy_downstream_connection.cc b/src/shrpx_spdy_downstream_connection.cc index 29dca1c..0c6c611 100644 --- a/src/shrpx_spdy_downstream_connection.cc +++ b/src/shrpx_spdy_downstream_connection.cc @@ -419,7 +419,12 @@ evbuffer* SpdyDownstreamConnection::get_request_body_buf() const void SpdyDownstreamConnection::attach_stream_data(StreamData *sd) { - assert(sd_ == 0 && sd->dconn == 0); + // It is possible sd->dconn is not NULL. sd is detached when + // on_stream_close_callback. Before that, after MSG_COMPLETE is set + // to Downstream::set_response_state(), upstream's readcb is called + // and execution path eventually could reach here. Since the + // response was already handled, we just detach sd. + detach_stream_data(); sd_ = sd; sd_->dconn = this; }