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 2011/04/18 21:11:11 UTC

svn commit: r1094696 - in /trafficserver/traffic/trunk: contrib/perl/AdminClient/lib/Apache/TS/ mgmt/ proxy/ proxy/api/ts/ proxy/http/

Author: zwoop
Date: Mon Apr 18 19:11:11 2011
New Revision: 1094696

URL: http://svn.apache.org/viewvc?rev=1094696&view=rev
Log:
TS-743 Support separate configs for keep-alive enabled for _in and _out connections

Modified:
    trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm
    trafficserver/traffic/trunk/mgmt/RecordsConfig.cc
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/InkAPITest.cc
    trafficserver/traffic/trunk/proxy/api/ts/ts.h.in
    trafficserver/traffic/trunk/proxy/http/HttpConfig.cc
    trafficserver/traffic/trunk/proxy/http/HttpConfig.h
    trafficserver/traffic/trunk/proxy/http/HttpTransact.cc

Modified: trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm (original)
+++ trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm Mon Apr 18 19:11:11 2011
@@ -477,7 +477,8 @@ The Apache Traffic Server Administration
  proxy.config.http.insert_request_via_str
  proxy.config.http.insert_response_via_str
  proxy.config.http.insert_squid_x_forwarded_for
- proxy.config.http.keep_alive_enabled
+ proxy.config.http.keep_alive_enabled_in
+ proxy.config.http.keep_alive_enabled_out
  proxy.config.http.keep_alive_no_activity_timeout_in
  proxy.config.http.keep_alive_no_activity_timeout_out
  proxy.config.http.keep_alive_post_out

Modified: trafficserver/traffic/trunk/mgmt/RecordsConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/RecordsConfig.cc?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/RecordsConfig.cc (original)
+++ trafficserver/traffic/trunk/mgmt/RecordsConfig.cc Mon Apr 18 19:11:11 2011
@@ -436,7 +436,9 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.http.use_client_target_addr", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.http.keep_alive_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  {RECT_CONFIG, "proxy.config.http.keep_alive_enabled_in", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CONFIG, "proxy.config.http.keep_alive_enabled_out", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.http.keep_alive_post_out", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,

Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Mon Apr 18 19:11:11 2011
@@ -7178,8 +7178,11 @@ _conf_to_memberp(TSOverridableConfigKey 
   case TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE:
     ret = &sm->t_state.txn_conf->cache_when_to_revalidate;
     break;
-  case TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED:
-    ret = &sm->t_state.txn_conf->keep_alive_enabled;
+  case TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN:
+    ret = &sm->t_state.txn_conf->keep_alive_enabled_in;
+    break;
+  case TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT:
+    ret = &sm->t_state.txn_conf->keep_alive_enabled_out;
     break;
   case TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT:
     ret = &sm->t_state.txn_conf->keep_alive_post_out;
@@ -7509,11 +7512,6 @@ TSHttpTxnConfigFind(const char* name, in
       cnf = TS_CONFIG_HTTP_CHUNKING_ENABLED;
     break;
 
-  case 36:
-    if (!strncmp(name, "proxy.config.http.keep_alive_enabled", length))
-      cnf = TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED;
-    break;
-
   case 37:
     switch (name[length-1]) {
     case 'e':
@@ -7545,6 +7543,8 @@ TSHttpTxnConfigFind(const char* name, in
   case 39:
     if (!strncmp(name, "proxy.config.http.anonymize_remove_from", length))
       cnf = TS_CONFIG_HTTP_ANONYMIZE_REMOVE_FROM;
+    else if (!strncmp(name, "proxy.config.http.keep_alive_enabled_in", length))
+      cnf = TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN;
     break;
 
   case 40:
@@ -7565,6 +7565,9 @@ TSHttpTxnConfigFind(const char* name, in
       else if (!strncmp(name, "proxy.config.http.cache.required_headers", length))
         cnf = TS_CONFIG_HTTP_CACHE_REQUIRED_HEADERS;
       break;
+    case 't':
+      if (!strncmp(name, "proxy.config.http.keep_alive_enabled_out", length))
+        cnf = TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT;
     case 'y':
       if (!strncmp(name, "proxy.config.http.cache.fuzz.probability", length))
         cnf = TS_CONFIG_HTTP_CACHE_FUZZ_PROBABILITY;

Modified: trafficserver/traffic/trunk/proxy/InkAPITest.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPITest.cc?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPITest.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPITest.cc Mon Apr 18 19:11:11 2011
@@ -7489,7 +7489,8 @@ const char *SDK_Overridable_Configs[] = 
   "proxy.config.http.negative_caching_enabled",
   "proxy.config.http.negative_caching_lifetime",
   "proxy.config.http.cache.when_to_revalidate",
-  "proxy.config.http.keep_alive_enabled",
+  "proxy.config.http.keep_alive_enabled_in",
+  "proxy.config.http.keep_alive_enabled_out",
   "proxy.config.http.keep_alive_post_out",
   "proxy.config.net.sock_recv_buffer_size_out",
   "proxy.config.net.sock_send_buffer_size_out",

Modified: trafficserver/traffic/trunk/proxy/api/ts/ts.h.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/api/ts/ts.h.in?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/api/ts/ts.h.in (original)
+++ trafficserver/traffic/trunk/proxy/api/ts/ts.h.in Mon Apr 18 19:11:11 2011
@@ -491,7 +491,8 @@ extern "C"
     TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED,
     TS_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME,
     TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE,
-    TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED,
+    TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN,
+    TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT,
     TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT,
     TS_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT,
     TS_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT,

Modified: trafficserver/traffic/trunk/proxy/http/HttpConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpConfig.cc?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpConfig.cc Mon Apr 18 19:11:11 2011
@@ -1178,7 +1178,8 @@ HttpConfig::startup()
   HttpEstablishStaticConfigStringAlloc(c.url_expansions_string, "proxy.config.dns.url_expansions");
   HttpEstablishStaticConfigLongLong(c.proxy_server_port, "proxy.config.http.server_port");
   HttpEstablishStaticConfigStringAlloc(c.proxy_server_other_ports, "proxy.config.http.server_other_ports");
-  HttpEstablishStaticConfigByte(c.oride.keep_alive_enabled, "proxy.config.http.keep_alive_enabled");
+  HttpEstablishStaticConfigByte(c.oride.keep_alive_enabled_in, "proxy.config.http.keep_alive_enabled_in");
+  HttpEstablishStaticConfigByte(c.oride.keep_alive_enabled_out, "proxy.config.http.keep_alive_enabled_out");
   HttpEstablishStaticConfigByte(c.oride.chunking_enabled, "proxy.config.http.chunking_enabled");
   HttpEstablishStaticConfigByte(c.session_auth_cache_keep_alive_enabled,
                                 "proxy.config.http.session_auth_cache_keep_alive_enabled");
@@ -1456,7 +1457,8 @@ HttpConfig::reconfigure()
 
   params->proxy_server_port = m_master.proxy_server_port;
   params->proxy_server_other_ports = xstrdup(m_master.proxy_server_other_ports);
-  params->oride.keep_alive_enabled = INT_TO_BOOL(m_master.oride.keep_alive_enabled);
+  params->oride.keep_alive_enabled_in = INT_TO_BOOL(m_master.oride.keep_alive_enabled_in);
+  params->oride.keep_alive_enabled_out = INT_TO_BOOL(m_master.oride.keep_alive_enabled_out);
   params->oride.chunking_enabled = INT_TO_BOOL(m_master.oride.chunking_enabled);
   params->session_auth_cache_keep_alive_enabled = INT_TO_BOOL(m_master.session_auth_cache_keep_alive_enabled);
   params->origin_server_pipeline = m_master.origin_server_pipeline;

Modified: trafficserver/traffic/trunk/proxy/http/HttpConfig.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpConfig.h?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpConfig.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpConfig.h Mon Apr 18 19:11:11 2011
@@ -406,8 +406,8 @@ struct HttpConfigPortRange
 struct OverridableHttpConfigParams {
   OverridableHttpConfigParams()
     :  maintain_pristine_host_hdr(0), chunking_enabled(0),
-       negative_caching_enabled(0), negative_caching_lifetime(0),
-       cache_when_to_revalidate(0), keep_alive_enabled(0), keep_alive_post_out(0),
+       negative_caching_enabled(0), negative_caching_lifetime(0), cache_when_to_revalidate(0),
+       keep_alive_enabled_in(0), keep_alive_enabled_out(0), keep_alive_post_out(0),
        sock_recv_buffer_size_out(0), sock_send_buffer_size_out(0), sock_option_flag_out(0),
        anonymize_remove_from(0), anonymize_remove_referer(0), anonymize_remove_user_agent(0),
        anonymize_remove_cookie(0), anonymize_remove_client_ip(0), anonymize_insert_client_ip(1),
@@ -451,7 +451,8 @@ struct OverridableHttpConfigParams {
 
   MgmtByte cache_when_to_revalidate;
 
-  MgmtByte keep_alive_enabled;
+  MgmtByte keep_alive_enabled_in;
+  MgmtByte keep_alive_enabled_out;
   MgmtByte keep_alive_post_out;  // share server sessions for post
 
   ///////////////////////////////////////

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.cc?rev=1094696&r1=1094695&r2=1094696&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.cc Mon Apr 18 19:11:11 2011
@@ -2573,7 +2573,7 @@ HttpTransact::HandleCacheOpenReadHit(Sta
       // we haven't done the ICP lookup yet. The following is to
       // fake an icp_info to cater for build_request's needs
       s->icp_info.http_version.set(1, 0);
-      if (!s->txn_conf->keep_alive_enabled || s->http_config_param->origin_server_pipeline == 0) {
+      if (!s->txn_conf->keep_alive_enabled_out || s->http_config_param->origin_server_pipeline == 0) {
         s->icp_info.keep_alive = HTTP_NO_KEEPALIVE;
       } else {
         s->icp_info.keep_alive = HTTP_KEEPALIVE;
@@ -3049,7 +3049,7 @@ HttpTransact::HandleICPLookup(State* s)
     //   values are not initialized.
     // Force them to be initialized
     s->icp_info.http_version.set(1, 0);
-    if (!s->txn_conf->keep_alive_enabled || s->http_config_param->origin_server_pipeline == 0) {
+    if (!s->txn_conf->keep_alive_enabled_out || s->http_config_param->origin_server_pipeline == 0) {
       s->icp_info.keep_alive = HTTP_NO_KEEPALIVE;
     } else {
       s->icp_info.keep_alive = HTTP_KEEPALIVE;
@@ -5085,7 +5085,7 @@ HttpTransact::get_ka_info_from_host_db(S
   /////////////////////////////
   // origin server keep_alive //
   /////////////////////////////
-  if ((!s->txn_conf->keep_alive_enabled) || (s->http_config_param->origin_server_pipeline == 0)) {
+  if ((!s->txn_conf->keep_alive_enabled_out) || (s->http_config_param->origin_server_pipeline == 0)) {
     server_info->keep_alive = HTTP_NO_KEEPALIVE;
   }
   ///////////////////////////////
@@ -5635,7 +5635,7 @@ HttpTransact::initialize_state_variables
   //
   MIMEField *pc = incoming_request->field_find(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION);
 
-  if (!s->txn_conf->keep_alive_enabled || (s->http_config_param->server_transparency_enabled && pc != NULL)) {
+  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,