shrpx: Fix assertion failure in SpdyDownstreamConnection::attach_stream_data

This commit is contained in:
Tatsuhiro Tsujikawa 2013-03-07 21:32:10 +09:00
parent 11026a3eda
commit 4461cb24ed
1 changed files with 6 additions and 1 deletions

View File

@ -419,7 +419,12 @@ evbuffer* SpdyDownstreamConnection::get_request_body_buf() const
void SpdyDownstreamConnection::attach_stream_data(StreamData *sd) 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_ = sd;
sd_->dconn = this; sd_->dconn = this;
} }