Skip to content

Commit

Permalink
Merge branch 'nghttpx-fix-chunked-request-stall'
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Apr 15, 2019
2 parents dce91ad + 2cff8b4 commit 5a30faf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/shrpx_http_downstream_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,9 @@ int HttpDownstreamConnection::process_blocked_request_buf() {
}
}

if (downstream_->get_blocked_request_data_eof()) {
return end_upload_data();
if (downstream_->get_blocked_request_data_eof() &&
downstream_->get_chunked_request()) {
end_upload_data_chunk();
}

return 0;
Expand Down Expand Up @@ -751,6 +752,12 @@ int HttpDownstreamConnection::end_upload_data() {
return 0;
}

end_upload_data_chunk();

return 0;
}

void HttpDownstreamConnection::end_upload_data_chunk() {
const auto &req = downstream_->request();

auto output = downstream_->get_request_buf();
Expand All @@ -763,8 +770,6 @@ int HttpDownstreamConnection::end_upload_data() {
http2::HDOP_STRIP_ALL);
output->append("\r\n");
}

return 0;
}

namespace {
Expand Down
1 change: 1 addition & 0 deletions src/shrpx_http_downstream_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class HttpDownstreamConnection : public DownstreamConnection {
virtual int push_request_headers();
virtual int push_upload_data_chunk(const uint8_t *data, size_t datalen);
virtual int end_upload_data();
void end_upload_data_chunk();

virtual void pause_read(IOCtrlReason reason);
virtual int resume_read(IOCtrlReason reason, size_t consumed);
Expand Down

0 comments on commit 5a30faf

Please sign in to comment.