shrpx: Deadlock with upload data in clinet mode

This commit is contained in:
Tatsuhiro Tsujikawa 2012-11-18 23:48:55 +09:00
parent 19bf97b3e5
commit 52c4d26927
1 changed files with 10 additions and 6 deletions

View File

@ -309,25 +309,29 @@ 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);
}
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()
{
if(downstream_->get_downstream_stream_id() != -1) {
spdylay_session_resume_data(session_,
downstream_->get_downstream_stream_id());
}
return send();
} else {
return 0;
}
}
namespace {
ssize_t send_callback(spdylay_session *session,