diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index f1a0c57e..276fe88a 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -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 { diff --git a/src/shrpx_http_downstream_connection.h b/src/shrpx_http_downstream_connection.h index 8b33ddd1..e629308f 100644 --- a/src/shrpx_http_downstream_connection.h +++ b/src/shrpx_http_downstream_connection.h @@ -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);