trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ushac...@apache.org
Subject git commit: Remove long dead config options that were always false
Date Mon, 07 Oct 2013 16:26:03 GMT
Updated Branches:
  refs/heads/master 847816c6b -> 444f647ee


Remove long dead config options that were always false


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

Branch: refs/heads/master
Commit: 444f647ee6c1aebe6c469e9d24dec0d7ff790c0f
Parents: 847816c
Author: Uri Shachar <ushachar@apache.org>
Authored: Mon Oct 7 19:18:03 2013 +0300
Committer: Uri Shachar <ushachar@apache.org>
Committed: Mon Oct 7 19:18:03 2013 +0300

----------------------------------------------------------------------
 proxy/http/HttpConfig.cc   | 21 -------------------
 proxy/http/HttpConfig.h    | 10 ---------
 proxy/http/HttpTransact.cc | 45 ++++++++++++-----------------------------
 3 files changed, 13 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/444f647e/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 461a9b7..dcc232b 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1346,27 +1346,6 @@ HttpConfig::startup()
   HttpEstablishStaticConfigLongLong(c.number_of_redirections, "proxy.config.http.number_of_redirections");
   HttpEstablishStaticConfigLongLong(c.post_copy_size, "proxy.config.http.post_copy_size");
 
-  // Transparency flag.
-  char buffer[10];
-  if (REC_ERR_OKAY ==  RecGetRecordString("proxy.config.http.transparent",
-					  buffer, sizeof(buffer))) {
-    if (0 == strcasecmp("both", buffer) ||
-	0 == strcasecmp("on", buffer) ||
-	0 == strcasecmp("enable", buffer)) {
-      c.client_transparency_enabled = true;
-      c.server_transparency_enabled = true;
-    } else if (0 == strcasecmp("server", buffer)) {
-      c.server_transparency_enabled = true;
-      c.client_transparency_enabled = false;
-    } else if (0 == strcasecmp("client", buffer)) {
-      c.server_transparency_enabled = false;
-      c.client_transparency_enabled = true;
-    } else {
-      c.server_transparency_enabled = false;
-      c.client_transparency_enabled = false;
-    }
-  }
-
   // Cluster time delta gets it own callback since it needs
   //  to use ink_atomic_swap
   c.cluster_time_delta = 0;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/444f647e/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index c220463..033ee7f 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -728,14 +728,6 @@ public:
   MgmtByte referer_filter_enabled;
   MgmtByte referer_format_redirect;
 
-  //////////////////
-  // Transparency //
-  //////////////////
-  /// Accept connections on foreign addresses.
-  bool client_transparency_enabled;
-  /// Use client address to connect to origin server.
-  bool server_transparency_enabled;
-
   ///////////////////
   // reverse proxy //
   ///////////////////
@@ -924,8 +916,6 @@ HttpConfigParams::HttpConfigParams()
     push_method_enabled(0),
     referer_filter_enabled(0),
     referer_format_redirect(0),
-    client_transparency_enabled(false),
-    server_transparency_enabled(false),
     reverse_proxy_enabled(0),
     url_remap_required(1),
     record_cop_page(0),

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/444f647e/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index de180aa..de4052a 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5443,29 +5443,22 @@ HttpTransact::initialize_state_variables_from_request(State* s, HTTPHdr*
obsolet
   //  when they are configured to use a proxy.  Proxy-Connection
   //  is not in the spec but was added to prevent problems
   //  with a dumb proxy forwarding all headers (including "Connection")
-  //  to the origin server and confusing it.  However, the
-  //  "Proxy-Connection" solution breaks down with transparent
-  //  backbone caches since the request could be from dumb
-  //  downstream caches that are forwarding the "Proxy-Connection"
-  //  header.  Therefore, we disable keep-alive if we are transparent
-  //  and see "Proxy-Connection" header
-  //
+  //  to the origin server and confusing it.  In cases of transparent
+  //  deployments we use the Proxy-Connect hdr (to be as transparent
+  //  as possible).
   MIMEField *pc = incoming_request->field_find(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION);
 
-  if (!s->txn_conf->keep_alive_enabled_in || (s->http_config_param->server_transparency_enabled
&& pc != NULL)) {
-    s->client_info.keep_alive = HTTP_NO_KEEPALIVE;
+  // If we need to send a close header later check to see if it should be "Proxy-Connection"
+  if (pc != NULL) {
+    s->client_info.proxy_connect_hdr = true;
+  }
 
-    // If we need to send a close header later,
-    //   check to see if it should be "Proxy-Connection"
-    if (pc != NULL) {
-      s->client_info.proxy_connect_hdr = true;
-    }
+  if (!s->txn_conf->keep_alive_enabled_in) {
+    s->client_info.keep_alive = HTTP_NO_KEEPALIVE;
   } else {
-    // If there is a Proxy-Connection header use that,
-    //   otherwise use the Connection header
+    // If there is a Proxy-Connection header use that, otherwise use the Connection header
     if (pc != NULL) {
       s->client_info.keep_alive = is_header_keep_alive(s->client_info.http_version,
s->client_info.http_version, pc);
-      s->client_info.proxy_connect_hdr = true;
     } else {
       MIMEField *c = incoming_request->field_find(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION);
 
@@ -6202,27 +6195,15 @@ HttpTransact::is_request_valid(State* s, HTTPHdr* incoming_request)
 
     DebugTxn("http_trans", "[is_request_valid] missing host field");
     SET_VIA_STRING(VIA_DETAIL_TUNNEL, VIA_DETAIL_TUNNEL_NO_FORWARD);
-    // Transparent client side, but client did not provide any HOST information
-    // (neither in the URL nor a HOST header).
-    if (s->http_config_param->client_transparency_enabled) {
-      build_error_response(s, HTTP_STATUS_BAD_REQUEST, "Host Header Required",
-                           "interception#no_host", 
-                           "An attempt was made to transparently proxy your request, "
-                           "but this attempt failed because your browser did not "
-                           "send an HTTP 'Host' header.<p>Please manually configure
"
-                           "your browser to use 'http://%s' as an HTTP proxy. "
-                           "Please refer to your browser's documentation for details. ",
-                           s->http_config_param->proxy_hostname);
-    } else if (s->http_config_param->reverse_proxy_enabled) {   // host header missing,
and transparency off but reverse
-      // proxy on
+    if (s->http_config_param->reverse_proxy_enabled) {   // host header missing and
reverse proxy on
       build_error_response(s, HTTP_STATUS_BAD_REQUEST, "Host Header Required", "request#no_host",
-                           // This too is all one long string
+                           // This is all one long string
                            "Your browser did not send \"Host:\" HTTP header field, "
                            "and therefore the virtual host being requested could "
                            "not be determined.  To access this site you will need "
                            "to upgrade to a browser that supports the HTTP " "\"Host:\" header
field.");
     } else {
-      // host header missing, and transparency & reverse proxy off
+      // host header missing and reverse proxy off
       build_error_response(s, HTTP_STATUS_BAD_REQUEST, "Host Required In Request", "request#no_host",
                            // This too is all one long string
                            "Your browser did not send a hostname as part of "


Mime
View raw message