You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2011/10/06 21:39:51 UTC

svn commit: r1179785 - in /trafficserver/traffic/trunk: CHANGES proxy/http/HttpTransact.cc

Author: amc
Date: Thu Oct  6 19:39:50 2011
New Revision: 1179785

URL: http://svn.apache.org/viewvc?rev=1179785&view=rev
Log:
TS-945 Convert transparent forward request to server proxy request when forwarding to parent proxy.

Modified:
    trafficserver/traffic/trunk/CHANGES
    trafficserver/traffic/trunk/proxy/http/HttpTransact.cc

Modified: trafficserver/traffic/trunk/CHANGES
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/CHANGES?rev=1179785&r1=1179784&r2=1179785&view=diff
==============================================================================
--- trafficserver/traffic/trunk/CHANGES (original)
+++ trafficserver/traffic/trunk/CHANGES Thu Oct  6 19:39:50 2011
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.1.1
+  *) [TS-945] Convert transparent forward requests to server style when
+     forwarding to a parent proxy.
+
   *) [TS-957] remove IE6 from the white list of ae_ua filter
 
   *) [TS-955] Fix the logging regression testing.

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.cc?rev=1179785&r1=1179784&r2=1179785&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.cc Thu Oct  6 19:39:50 2011
@@ -7815,6 +7815,18 @@ HttpTransact::build_request(State* s, HT
       (s->next_hop_scheme == URL_WKSIDX_HTTP || s->next_hop_scheme == URL_WKSIDX_HTTPS)) {
     HttpTransactHeaders::remove_host_name_from_url(outgoing_request);
   }
+
+  // If we're going to a parent proxy, make sure we pass host and port
+  // in the URL even if we didn't get them (e.g. transparent proxy)
+  if (s->current.request_to == PARENT_PROXY &&
+      !outgoing_request->is_target_in_url()) {
+    Debug("http_trans", "[build_request] adding target to URL for parent proxy");
+
+    // No worry about HTTP/0.9 because we reject forward proxy requests that
+    // don't have a host anywhere.
+    outgoing_request->set_url_target_from_host_field();
+  }
+
   // If the response is most likely not cacheable, eg, request with Authorization,
   // do we really want to remove conditional headers to get large 200 response?
   // Answer: NO.  Since if the response is most likely not cacheable,