trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject [trafficserver] branch 6.2.x updated: TS-4720 correctly check if requests have a body
Date Tue, 22 Nov 2016 22:16:19 GMT
This is an automated email from the ASF dual-hosted git repository.

sorber pushed a commit to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/6.2.x by this push:
       new  b853669   TS-4720 correctly check if requests have a body
b853669 is described below

commit b85366944eee54ce00fb3d9df7acdc05acbdc057
Author: Thomas Jackson <jacksontj.89@gmail.com>
AuthorDate: Thu Aug 4 17:55:59 2016 -0700

    TS-4720 correctly check if requests have a body
    
    HttpTransact defaults content length to `-1`, meaning that if the request has no content
length header it will be `-1`. These checks weren't taking that into consideration -- meaning
client aborts during requests with no content length (GET for example) would leave the origin
session open until another timeout kicked in.
    
    (cherry picked from commit a075556602d77d79f5a02e2a36053abfa92703f0)
---
 proxy/http/HttpSM.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index b7a1be2..d0b51f6 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -794,7 +794,7 @@ HttpSM::state_read_client_request_header(int event, void *data)
     }
 
     if (t_state.hdr_info.client_request.method_get_wksidx() == HTTP_WKSIDX_TRACE ||
-        (t_state.hdr_info.request_content_length == 0 && t_state.client_info.transfer_encoding
!= HttpTransact::CHUNKED_ENCODING)) {
+        (t_state.hdr_info.request_content_length <= 0 && t_state.client_info.transfer_encoding
!= HttpTransact::CHUNKED_ENCODING)) {
       // Enable further IO to watch for client aborts
       ua_entry->read_vio->reenable();
     } else {
@@ -5169,7 +5169,7 @@ HttpSM::mark_server_down_on_client_abort()
   //  that upstream proxy may be working but         //
   //  the actual origin server is one that is hung   //
   /////////////////////////////////////////////////////
-  if (t_state.current.request_to == HttpTransact::ORIGIN_SERVER && t_state.hdr_info.request_content_length
== 0) {
+  if (t_state.current.request_to == HttpTransact::ORIGIN_SERVER && t_state.hdr_info.request_content_length
<= 0) {
     if (milestones[TS_MILESTONE_SERVER_FIRST_CONNECT] != 0 && milestones[TS_MILESTONE_SERVER_FIRST_READ]
== 0) {
       // Check to see if client waited for the threshold
       //  to declare the origin server as down

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message