diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index f68cfcf5..1c39c7f9 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -891,8 +891,7 @@ int htp_msg_begincb(llhttp_t *htp) { auto downstream = static_cast(htp->data); if (downstream->get_response_state() != DownstreamState::INITIAL) { - llhttp_set_error_reason(htp, "HTTP message started when it shouldn't"); - return HPE_USER; + return -1; } return 0; diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index 34a5504b..e7090d55 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -559,8 +559,7 @@ int htp_msg_completecb(llhttp_t *htp) { // signal_write() to run on_write(). return HPE_PAUSED; } - llhttp_set_error_reason(htp, "could not finish request body"); - return HPE_USER; + return -1; } if (handler->get_http2_upgrade_allowed() &&