trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject trafficserver git commit: TS-4285 Makes proxy.config.http.attach_server_session_to_client overridable
Date Sat, 26 Mar 2016 14:58:52 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 5b2622eac -> cbcaf312b


TS-4285 Makes proxy.config.http.attach_server_session_to_client overridable

This closes #531


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

Branch: refs/heads/master
Commit: cbcaf312b1f6643e03e340bc337c53ae3b09d135
Parents: 5b2622e
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Thu Mar 17 16:23:59 2016 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Sat Mar 26 08:53:05 2016 -0600

----------------------------------------------------------------------
 doc/admin-guide/files/records.config.en.rst      | 1 +
 lib/ts/apidefs.h.in                              | 1 +
 plugins/experimental/ts_lua/ts_lua_http_config.c | 4 +++-
 proxy/InkAPI.cc                                  | 9 +++++++++
 proxy/InkAPITest.cc                              | 3 ++-
 proxy/http/HttpConfig.cc                         | 4 ++--
 proxy/http/HttpConfig.h                          | 3 ++-
 proxy/http/HttpSM.cc                             | 3 +--
 8 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/doc/admin-guide/files/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 225a168..d0b49cf 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -891,6 +891,7 @@ Value Effect
    ========== =================================================================
 
 .. ts:cv:: CONFIG proxy.config.http.attach_server_session_to_client INT 0
+   :overridable:
 
    Control the re-use of an server session by a user agent (client) session.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/lib/ts/apidefs.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index e8acced..ae366f1 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -693,6 +693,7 @@ typedef enum {
   TS_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS,
   TS_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES,
   TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY,
+  TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT,
   TS_CONFIG_LAST_ENTRY
 } TSOverridableConfigKey;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/plugins/experimental/ts_lua/ts_lua_http_config.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c b/plugins/experimental/ts_lua/ts_lua_http_config.c
index 738cd0d..5b995be 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_config.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_config.c
@@ -113,6 +113,7 @@ typedef enum {
   TS_LUA_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS = TS_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS,
   TS_LUA_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES = TS_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES,
   TS_LUA_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY = TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY,
+  TS_LUA_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT = TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT,
   TS_LUA_CONFIG_LAST_ENTRY = TS_CONFIG_LAST_ENTRY,
 } TSLuaOverridableConfigKey;
 
@@ -196,7 +197,8 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_OPEN_WRITE_FAIL_ACTION),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ENABLE_REDIRECTION), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES),
-  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
+  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY),
+  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
 };
 
 // Needed to make sure we have the latest list of overridable http config vars when compiling

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 1b780bd..ee6cc08 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -7974,6 +7974,10 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams
*overr
     typ = OVERRIDABLE_TYPE_INT;
     ret = &overridableHttpConfig->redirect_use_orig_cache_key;
     break;
+  case TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT:
+    typ = OVERRIDABLE_TYPE_INT;
+    ret = &overridableHttpConfig->attach_server_session_to_client;
+    break;
   // This helps avoiding compiler warnings, yet detect unhandled enum members.
   case TS_CONFIG_NULL:
   case TS_CONFIG_LAST_ENTRY:
@@ -8557,6 +8561,11 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey
*conf,
     }
     break;
 
+  case 49:
+    if (!strncmp(name, "proxy.config.http.attach_server_session_to_client", length))
+      cnf = TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT;
+    break;
+
   case 50:
     if (!strncmp(name, "proxy.config.http.cache.cache_responses_to_cookies", length))
       cnf = TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 208fb7f..8c2f8b6 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7218,7 +7218,8 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
   "proxy.config.http.auth_server_session_private", "proxy.config.http.slow.log.threshold",
"proxy.config.http.cache.generation",
   "proxy.config.body_factory.template_base", "proxy.config.http.cache.open_write_fail_action",
   "proxy.config.http.redirection_enabled", "proxy.config.http.number_of_redirections",
-  "proxy.config.http.cache.max_open_write_retries", "proxy.config.http.redirect_use_orig_cache_key"};
+  "proxy.config.http.cache.max_open_write_retries", "proxy.config.http.redirect_use_orig_cache_key",
+  "proxy.config.http.attach_server_session_to_client"};
 
 REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* atype ATS_UNUSED
*/, int *pstatus)
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 96bcaee..d2b84e7 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -892,7 +892,7 @@ HttpConfig::startup()
   HttpEstablishStaticConfigLongLong(c.oride.server_tcp_init_cwnd, "proxy.config.http.server_tcp_init_cwnd");
   HttpEstablishStaticConfigLongLong(c.oride.origin_max_connections, "proxy.config.http.origin_max_connections");
   HttpEstablishStaticConfigLongLong(c.origin_min_keep_alive_connections, "proxy.config.http.origin_min_keep_alive_connections");
-  HttpEstablishStaticConfigLongLong(c.attach_server_session_to_client, "proxy.config.http.attach_server_session_to_client");
+  HttpEstablishStaticConfigLongLong(c.oride.attach_server_session_to_client, "proxy.config.http.attach_server_session_to_client");
 
   HttpEstablishStaticConfigByte(c.parent_proxy_routing_enable, "proxy.config.http.parent_proxy_routing_enable");
 
@@ -1163,7 +1163,7 @@ HttpConfig::reconfigure()
   params->oride.server_tcp_init_cwnd = m_master.oride.server_tcp_init_cwnd;
   params->oride.origin_max_connections = m_master.oride.origin_max_connections;
   params->origin_min_keep_alive_connections = m_master.origin_min_keep_alive_connections;
-  params->attach_server_session_to_client = m_master.attach_server_session_to_client;
+  params->oride.attach_server_session_to_client = m_master.oride.attach_server_session_to_client;
 
   if (params->oride.origin_max_connections && params->oride.origin_max_connections
< params->origin_min_keep_alive_connections) {
     Warning("origin_max_connections < origin_min_keep_alive_connections, setting min=max
, please correct your records.config");

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index ee33bbb..4b54ea1 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -529,6 +529,8 @@ struct OverridableHttpConfigParams {
   MgmtInt transaction_active_timeout_out;
   MgmtInt origin_max_connections;
 
+  MgmtInt attach_server_session_to_client;
+
   ////////////////////////////////////
   // origin server connect attempts //
   ////////////////////////////////////
@@ -632,7 +634,6 @@ public:
 
   MgmtInt server_max_connections;
   MgmtInt origin_min_keep_alive_connections; // TODO: This one really ought to be overridable,
but difficult right now.
-  MgmtInt attach_server_session_to_client;
   MgmtInt max_websocket_connections;
 
   MgmtByte parent_proxy_routing_enable;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cbcaf312/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 28ef1aa..90ac195 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -3016,8 +3016,7 @@ HttpSM::tunnel_handler_server(int event, HttpTunnelProducer *p)
     // server session to so the next ka request can use it.  Server sessions will
     // be placed into the shared pool if the next incoming request is for a different
     // origin server
-    if (t_state.http_config_param->attach_server_session_to_client == 1 && ua_session
&&
-        t_state.client_info.keep_alive == HTTP_KEEPALIVE) {
+    if (t_state.txn_conf->attach_server_session_to_client == 1 && ua_session &&
t_state.client_info.keep_alive == HTTP_KEEPALIVE) {
       Debug("http", "attaching server session to the client");
       ua_session->attach_server_session(server_session);
     } else {


Mime
View raw message