From 52c4d26927af5c3d0a3f9be1cd84a4f0e93326e5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 18 Nov 2012 23:48:55 +0900 Subject: [PATCH] shrpx: Deadlock with upload data in clinet mode --- src/shrpx_spdy_downstream_connection.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/shrpx_spdy_downstream_connection.cc b/src/shrpx_spdy_downstream_connection.cc index 0aad71c1..63ec1edb 100644 --- a/src/shrpx_spdy_downstream_connection.cc +++ b/src/shrpx_spdy_downstream_connection.cc @@ -309,15 +309,17 @@ int SpdyDownstreamConnection::push_upload_data_chunk(const uint8_t *data, LOG(FATAL) << "evbuffer_add() failed"; return -1; } - if(downstream_->get_downstream_stream_id() != -1) { - spdylay_session_resume_data(session_, - downstream_->get_downstream_stream_id()); - } size_t bodylen = evbuffer_get_length(request_body_buf_); if(bodylen > Downstream::DOWNSTREAM_OUTPUT_UPPER_THRES) { downstream_->get_upstream()->pause_read(SHRPX_NO_BUFFER); } - return 0; + if(downstream_->get_downstream_stream_id() != -1) { + spdylay_session_resume_data(session_, + downstream_->get_downstream_stream_id()); + return send(); + } else { + return 0; + } } int SpdyDownstreamConnection::end_upload_data() @@ -325,8 +327,10 @@ int SpdyDownstreamConnection::end_upload_data() if(downstream_->get_downstream_stream_id() != -1) { spdylay_session_resume_data(session_, downstream_->get_downstream_stream_id()); + return send(); + } else { + return 0; } - return 0; } namespace {