trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject [2/2] git commit: TS-1274: Transformation plugins can send content-length with non-identity transfer encoding
Date Fri, 25 May 2012 23:49:34 GMT
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 <briang@apache.org>
Authored: Fri May 25 16:47:58 2012 -0700
Committer: Brian Geffon <briang@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


Mime
View raw message