From 43a47aa08b50a9f81186f45dc15a532f53d8b507 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 13 May 2021 13:59:44 +0900 Subject: [PATCH] Do not return HPE_USER from where it is prohibited --- src/shrpx_http_downstream_connection.cc | 3 +-- src/shrpx_https_upstream.cc | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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() &&