Commit 2cff8b43 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Fix bug that chunked request stalls

parent ce962c3f
......@@ -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;
......@@ -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();
......@@ -763,8 +770,6 @@ int HttpDownstreamConnection::end_upload_data() {
http2::HDOP_STRIP_ALL);
output->append("\r\n");
}
return 0;
}
namespace {
......
......@@ -53,6 +53,7 @@ public:
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment