This is an automated email from the ASF dual-hosted git repository.

dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a7fabd5e6 Make sure we don't create a tunnel when no request body is 
present. (#12485)
3a7fabd5e6 is described below

commit 3a7fabd5e645de296af6ad0c939dd34336f6130b
Author: Damian Meden <[email protected]>
AuthorDate: Wed Sep 10 09:31:31 2025 +0200

    Make sure we don't create a tunnel when no request body is present. (#12485)
    
    This patch makes sure that we do not create the tunnel either with CL==0
     or no request body present.
    
    I found out that in some cases the tunnel were created anyway when no body
    was present and some requests ended up in 408.
    The main reason was the tunnel was created with CL = -1, so the tunnel was
    timing out waiting for data to be read on an “invalid” tunnel.
---
 src/proxy/http/HttpSM.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/proxy/http/HttpSM.cc b/src/proxy/http/HttpSM.cc
index 7c15aed232..c4a3bcb0f0 100644
--- a/src/proxy/http/HttpSM.cc
+++ b/src/proxy/http/HttpSM.cc
@@ -6308,9 +6308,10 @@ close_connection:
 void
 HttpSM::do_setup_client_request_body_tunnel(HttpVC_t to_vc_type)
 {
-  if (t_state.hdr_info.request_content_length == 0) {
-    // No tunnel is needed to transfer 0 bytes. Simply return without setting 
up
-    // a tunnel nor any of the other related logic around request bodies.
+  if (!_ua.get_txn()->has_request_body(t_state.hdr_info.request_content_length,
+                                       t_state.client_info.transfer_encoding 
== HttpTransact::TransferEncoding_t::CHUNKED)) {
+    // No tunnel is needed to transfer 0 bytes or when no request body is 
present.
+    // Simply return without setting up a tunnel nor any of the other related 
logic around request bodies.
     return;
   }
   bool chunked = t_state.client_info.transfer_encoding == 
HttpTransact::TransferEncoding_t::CHUNKED ||

Reply via email to