You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2012/05/26 01:49:34 UTC

[2/2] git commit: TS-1274: Transformation plugins can send content-length with non-identity transfer encoding

TS-1274: Transformation plugins can send content-length with non-identity transfer encoding


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3fb6f2fb
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3fb6f2fb
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3fb6f2fb

Branch: refs/heads/master
Commit: 3fb6f2fb559debb10bc6eb867e6ea30351e9ebdb
Parents: 0ca83ac
Author: Brian Geffon <br...@apache.org>
Authored: Fri May 25 16:47:58 2012 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Fri May 25 16:47:58 2012 -0700

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3fb6f2fb/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 68e7540..6a1e69e 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6993,6 +6993,14 @@ HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, HTTP
       s->client_info.receive_chunked_response = false;
     }
 
+    //make sure no content length header is send when transfer encoding is chunked
+    if ( s->client_info.receive_chunked_response ) {
+      s->hdr_info.trust_response_cl = false;
+
+      // And delete the header if it's already been added...
+      heads->field_delete(MIME_FIELD_CONTENT_LENGTH, MIME_LEN_CONTENT_LENGTH);
+    }
+
     // If we cannot trust the content length, we will close the connection
     // unless we are going to use chunked encoding or the client issued
     // a PUSH request