Skip to content
Permalink
Browse files

make proxy.config.http.request_buffer_enabled configurable and bug fix

This PR fixes issue apache#6021, apache#6022, apache#6023
  • Loading branch information
zizhong committed Oct 16, 2019
1 parent 52944ce commit 08089103e05109b978fa5b545b0d35d2a6294b17
Showing with 7 additions and 8 deletions.
  1. +2 −3 doc/admin-guide/files/records.config.en.rst
  2. +2 −0 mgmt/RecordsConfig.cc
  3. +2 −4 proxy/http/HttpSM.cc
  4. +1 −1 proxy/http/HttpTransact.cc
@@ -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
@@ -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}
@@ -3477,12 +3477,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
@@ -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);

0 comments on commit 0808910

Please sign in to comment.
You can’t perform that action at this time.