You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/10/21 19:28:59 UTC
[trafficserver] branch 9.0.x updated: make
proxy.config.http.request_buffer_enabled configurable and bug fix
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new df1ee26 make proxy.config.http.request_buffer_enabled configurable and bug fix
df1ee26 is described below
commit df1ee267bb6dfbefcb7d48550f672c208fdce3ea
Author: Zizhong Zhang <zi...@linkedin.com>
AuthorDate: Tue Oct 15 23:25:58 2019 -0700
make proxy.config.http.request_buffer_enabled configurable and bug fix
This PR fixes issue #6021, #6022, #6023
(cherry picked from commit 08089103e05109b978fa5b545b0d35d2a6294b17)
---
doc/admin-guide/files/records.config.en.rst | 5 ++---
mgmt/RecordsConfig.cc | 2 ++
proxy/http/HttpSM.cc | 6 ++----
proxy/http/HttpTransact.cc | 2 +-
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index c8284d5..81636d7 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -1091,11 +1091,10 @@ mptcp
.. ts:cv:: CONFIG proxy.config.http.request_buffer_enabled INT 0
:overridable:
- This is a configuration value that is overridable but not configurable. This is most likely an
- implementation error.
-
This enables buffering the content for incoming ``POST`` requests. If enabled no outbound
connection is made until the entire ``POST`` request has been buffered.
+ If enabled, `proxy.config.http.post_copy_size` needs to be set to the maximum of the post body
+ size allowed, otherwise, the post would fail.
.. ts:cv:: CONFIG proxy.config.http.request_line_max_size INT 65535
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index f983e96..ae33576 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -339,6 +339,8 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http.keep_alive_post_out", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
+ {RECT_CONFIG, "proxy.config.http.request_buffer_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
+ ,
{RECT_CONFIG, "proxy.config.http.chunking_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.chunking.size", RECD_INT, "4096", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index ec068e5..bded402 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -3423,12 +3423,10 @@ HttpSM::tunnel_handler_post_ua(int event, HttpTunnelProducer *p)
// server and close the ua
p->handler_state = HTTP_SM_POST_UA_FAIL;
set_ua_abort(HttpTransact::ABORTED, event);
-
+ p->vc->do_io_write(nullptr, 0, nullptr);
+ p->vc->do_io_shutdown(IO_SHUTDOWN_READ);
tunnel.chain_abort_all(p);
server_session = nullptr;
- p->read_vio = nullptr;
- p->vc->do_io_close(EHTTP_ERROR);
-
// the in_tunnel status on both the ua & and
// it's consumer must already be set to true. Previously
// we were setting it again to true but incorrectly in
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 2023688..4dd837c 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -1118,7 +1118,7 @@ HttpTransact::HandleRequest(State *s)
{
TxnDebug("http_trans", "START HttpTransact::HandleRequest");
- if (!s->state_machine->is_waiting_for_full_body) {
+ if (!s->state_machine->is_waiting_for_full_body && !s->state_machine->is_using_post_buffer) {
ink_assert(!s->hdr_info.server_request.valid());
HTTP_INCREMENT_DYN_STAT(http_incoming_requests_stat);