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 2017/11/28 23:56:16 UTC

[trafficserver] branch 7.1.x updated (835c0b1 -> c2df5ba)

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

zwoop pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 835c0b1  corrects response reason when failing to connect to origin
     new 5df005d  Reverts the changes from TS-3054
     new c2df5ba  bugfix for malformed chunked response will be cached under some terrible network circumstances, clang-format code indent adjusted too!

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 proxy/http/HttpSM.cc     | 24 ++++++++++++++----------
 proxy/http/HttpTunnel.cc |  6 +++++-
 2 files changed, 19 insertions(+), 11 deletions(-)

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

[trafficserver] 01/02: Reverts the changes from TS-3054

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 5df005d0a875bd0d6cd30e1e965a6c6281f01fba
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Nov 28 11:17:22 2017 -0700

    Reverts the changes from TS-3054
    
    Also see the discussion on #2699, for a more complete fix.
    
    (cherry picked from commit d372332b5a8f4cf0c5e5fffa9f4c6c143a53e242)
---
 proxy/http/HttpSM.cc | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 80fab37..9479283 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -2967,15 +2967,7 @@ bool
 HttpSM::is_http_server_eos_truncation(HttpTunnelProducer *p)
 {
   if ((p->do_dechunking || p->do_chunked_passthru) && p->chunked_handler.truncation) {
-    // TS-3054 - In the chunked cases, chunked data that is incomplete
-    // should not be cached, but it should be passed onto the client
-    // This makes ATS more transparent in the case of non-standard
-    // servers.  The cache aborts are dealt with in other checks
-    // on the truncation flag elsewhere in the code.  This return value
-    // invalidates the current data being passed over to the client.
-    // So changing it from return true to return false, so the partial data
-    // is passed onto the client.
-    return false;
+    return true;
   }
 
   //////////////////////////////////////////////////////////////

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

[trafficserver] 02/02: bugfix for malformed chunked response will be cached under some terrible network circumstances, clang-format code indent adjusted too!

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit c2df5ba8d33b5774a35d5bc06289a7808149a337
Author: 陶云星 <ta...@le.com>
AuthorDate: Mon Oct 23 19:56:55 2017 +0800

    bugfix for malformed chunked response will be cached under some terrible network circumstances,
    clang-format code indent adjusted too!
    
    (cherry picked from commit 9dae6f04f38096252fa6d967d549cf119b14a24a)
---
 proxy/http/HttpSM.cc     | 14 +++++++++++++-
 proxy/http/HttpTunnel.cc |  6 +++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 9479283..4d4209f 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -3070,7 +3070,19 @@ HttpSM::tunnel_handler_server(int event, HttpTunnelProducer *p)
         tunnel.append_message_to_producer_buffer(p, reason, reason_len);
         }
       */
-      tunnel.local_finish_all(p);
+      // add fix code for caching incompleted chunked response case under some terrible network circumstances
+      // disable cache write for the malformed chunked response
+      if ((p->do_dechunking || p->do_chunked_passthru) && p->chunked_handler.truncation) {
+        DebugSM("http", "[%" PRId64 "] [HttpSM::tunnel_handler_server] disable cache write due to server truncation but still send "
+                        "partial response to client",
+                sm_id);
+        tunnel.abort_cache_write_finish_others(p);
+        // We couldn't read all chunks successfully, disable keep-alive.
+        t_state.client_info.keep_alive     = HTTP_NO_KEEPALIVE;
+        t_state.current.server->keep_alive = HTTP_NO_KEEPALIVE;
+      } else {
+        tunnel.local_finish_all(p);
+      }
     }
     break;
 
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index d21e79d..b1691cc 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -1543,11 +1543,15 @@ HttpTunnel::finish_all_internal(HttpTunnelProducer *p, bool chain)
       if (chain == true && c->self_producer) {
         chain_finish_all(c->self_producer);
       }
+      // add fixed code for caching incompleted chunked response case under some terrible network circumstances
+      if (c->vc_type == HT_HTTP_CLIENT && p->chunked_handler.truncation == true) {
+        consumer_handler(VC_EVENT_EOS, c);
+      }
       // The IO Core will not call us back if there
       //   is nothing to do.  Check to see if there is
       //   nothing to do and take the appripriate
       //   action
-      if (c->write_vio && c->write_vio->nbytes == c->write_vio->ndone) {
+      else if (c->write_vio && c->write_vio->nbytes == c->write_vio->ndone) {
         consumer_handler(VC_EVENT_WRITE_COMPLETE, c);
       }
     }

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