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/01/01 18:09:18 UTC
svn commit: r1054258 [1/3] - in /trafficserver/traffic/trunk/proxy: ./
api/ts/ http2/
Author: zwoop
Date: Sat Jan 1 17:09:17 2011
New Revision: 1054258
URL: http://svn.apache.org/viewvc?rev=1054258&view=rev
Log:
TS-599 Added a few more options, and some cleanup.
Modified:
trafficserver/traffic/trunk/proxy/CacheControl.cc
trafficserver/traffic/trunk/proxy/CacheControl.h
trafficserver/traffic/trunk/proxy/InkAPI.cc
trafficserver/traffic/trunk/proxy/api/ts/ts.h.in
trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc
trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc
trafficserver/traffic/trunk/proxy/http2/HttpConfig.h
trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc
trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
trafficserver/traffic/trunk/proxy/http2/HttpTransact.h
trafficserver/traffic/trunk/proxy/http2/HttpTransactHeaders.cc
trafficserver/traffic/trunk/proxy/http2/HttpTransactHeaders.h
Modified: trafficserver/traffic/trunk/proxy/CacheControl.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/CacheControl.cc?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/CacheControl.cc (original)
+++ trafficserver/traffic/trunk/proxy/CacheControl.cc Sat Jan 1 17:09:17 2011
@@ -177,8 +177,7 @@ reloadCacheControl()
}
void
-getCacheControl(CacheControlResult *result, HttpRequestData *rdata, HttpConfigParams *h_params,
- OverridableHttpConfigParams *h_txn_conf, char *tag)
+getCacheControl(CacheControlResult *result, HttpRequestData *rdata, OverridableHttpConfigParams *h_txn_conf, char *tag)
{
rdata->tag = tag;
CacheControlTable->Match(rdata, result);
@@ -461,20 +460,4 @@ void
CacheControlRecord::UpdateMatch(CacheControlResult * result, RD * rdata)
{
}
-void
-getCacheControl(CacheControlResult * result, HttpRequestData * rdata, HttpConfigParams * h_params,
- OverridableHttpConfigParams *h_txn_conf)
-{
- if (h_txn_conf->cache_ignore_client_no_cache) {
- result->ignore_client_no_cache = true;
- }
-
- if (h_txn_conf->cache_ignore_server_no_cache) {
- result->ignore_server_no_cache = true;
- }
-
- if (!h_txn_conf->cache_ignore_client_cc_max_age) {
- result->ignore_client_cc_max_age = false;
- }
-}
#endif // INK_NO_ACL
Modified: trafficserver/traffic/trunk/proxy/CacheControl.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/CacheControl.h?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/CacheControl.h (original)
+++ trafficserver/traffic/trunk/proxy/CacheControl.h Sat Jan 1 17:09:17 2011
@@ -142,7 +142,7 @@ class URL;
struct HttpConfigParams;
struct OverridableHttpConfigParams;
-inkcoreapi void getCacheControl(CacheControlResult *result, HttpRequestData * rdata, HttpConfigParams * h_params,
+inkcoreapi void getCacheControl(CacheControlResult *result, HttpRequestData * rdata,
OverridableHttpConfigParams *h_txn_conf, char *tag = NULL);
inkcoreapi bool host_rule_in_CacheControlTable();
inkcoreapi bool ip_rule_in_CacheControlTable();
Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Sat Jan 1 17:09:17 2011
@@ -7374,97 +7374,152 @@ TSReturnCode TSSkipRemappingSet(TSHttpTx
return TS_SUCCESS;
}
-
-/* APIs to manipulate the overridable configuration options.
-*/
-TSReturnCode
-TSHttpTxnConfigIntSet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt value)
+// Little helper function to find the struct member
+TSMgmtInt*
+_conf_to_memberp(TSOverridableConfigKey conf, HttpSM* sm)
{
- if (sdk_sanity_check_txn(txnp) != TS_SUCCESS)
- return TS_ERROR;
-
- HttpSM *sm = (HttpSM*) txnp;
-
// *((MgmtInt*)(&(sm->t_state.txn_conf) + conf*sizeof(MgmtInt))) = value;
switch (conf) {
case TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR:
- sm->t_state.txn_conf.maintain_pristine_host_hdr = value;
+ return &sm->t_state.txn_conf.maintain_pristine_host_hdr;
break;
case TS_CONFIG_HTTP_CHUNKING_ENABLED:
- sm->t_state.txn_conf.chunking_enabled = value;
+ return &sm->t_state.txn_conf.chunking_enabled;
break;
case TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED:
- sm->t_state.txn_conf.negative_caching_enabled = value;
+ return &sm->t_state.txn_conf.negative_caching_enabled;
+ break;
+ case TS_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME:
+ return &sm->t_state.txn_conf.negative_caching_lifetime;
break;
case TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE:
- sm->t_state.txn_conf.cache_when_to_revalidate = value;
+ return &sm->t_state.txn_conf.cache_when_to_revalidate;
break;
case TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED:
- sm->t_state.txn_conf.keep_alive_enabled = value;
+ return &sm->t_state.txn_conf.keep_alive_enabled;
break;
case TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT:
- sm->t_state.txn_conf.keep_alive_post_out = value;
+ return &sm->t_state.txn_conf.keep_alive_post_out;
break;
case TS_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT:
- sm->t_state.txn_conf.sock_recv_buffer_size_out = value;
+ return &sm->t_state.txn_conf.sock_recv_buffer_size_out;
break;
case TS_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT:
- sm->t_state.txn_conf.sock_send_buffer_size_out = value;
+ return &sm->t_state.txn_conf.sock_send_buffer_size_out;
break;
case TS_CONFIG_NET_SOCK_OPTION_FLAG_OUT:
- sm->t_state.txn_conf.sock_option_flag_out = value;
+ return &sm->t_state.txn_conf.sock_option_flag_out;
break;
case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_FROM:
- sm->t_state.txn_conf.anonymize_remove_from = value;
+ return &sm->t_state.txn_conf.anonymize_remove_from;
break;
case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_REFERER:
- sm->t_state.txn_conf.anonymize_remove_referer = value;
+ return &sm->t_state.txn_conf.anonymize_remove_referer;
break;
case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT:
- sm->t_state.txn_conf.anonymize_remove_user_agent = value;
+ return &sm->t_state.txn_conf.anonymize_remove_user_agent;
break;
case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_COOKIE:
- sm->t_state.txn_conf.anonymize_remove_cookie = value;
+ return &sm->t_state.txn_conf.anonymize_remove_cookie;
break;
case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP:
- sm->t_state.txn_conf.anonymize_remove_client_ip = value;
+ return &sm->t_state.txn_conf.anonymize_remove_client_ip;
break;
case TS_CONFIG_HTTP_ANONYMIZE_INSERT_CLIENT_IP:
- sm->t_state.txn_conf.anonymize_insert_client_ip = value;
+ return &sm->t_state.txn_conf.anonymize_insert_client_ip;
break;
case TS_CONFIG_HTTP_APPEND_XFORWARDS_HEADER:
- sm->t_state.txn_conf.append_xforwards_header = value;
+ return &sm->t_state.txn_conf.append_xforwards_header;
break;
case TS_CONFIG_HTTP_RESPONSE_SERVER_ENABLED:
- sm->t_state.txn_conf.append_xforwards_header = value;
+ return &sm->t_state.txn_conf.append_xforwards_header;
break;
case TS_CONFIG_HTTP_INSERT_SQUID_X_FORWARDED_FOR:
- sm->t_state.txn_conf.append_xforwards_header = value;
+ return &sm->t_state.txn_conf.append_xforwards_header;
break;
case TS_CONFIG_HTTP_SEND_HTTP11_REQUESTS:
- sm->t_state.txn_conf.send_http11_requests = value;
+ return &sm->t_state.txn_conf.send_http11_requests;
break;
case TS_CONFIG_HTTP_CACHE_HTTP:
- sm->t_state.txn_conf.cache_http = value;
+ return &sm->t_state.txn_conf.cache_http;
break;
case TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_NO_CACHE:
- sm->t_state.txn_conf.cache_ignore_client_no_cache = value;
+ return &sm->t_state.txn_conf.cache_ignore_client_no_cache;
break;
case TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE:
- sm->t_state.txn_conf.cache_ignore_client_cc_max_age = value;
+ return &sm->t_state.txn_conf.cache_ignore_client_cc_max_age;
break;
case TS_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE:
- sm->t_state.txn_conf.cache_ims_on_client_no_cache = value;
+ return &sm->t_state.txn_conf.cache_ims_on_client_no_cache;
break;
case TS_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE:
- sm->t_state.txn_conf.cache_ignore_server_no_cache = value;
+ return &sm->t_state.txn_conf.cache_ignore_server_no_cache;
break;
- default:
- return TS_ERROR;
+ case TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES:
+ return &sm->t_state.txn_conf.cache_responses_to_cookies;
+ break;
+ case TS_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION:
+ return &sm->t_state.txn_conf.cache_ignore_auth;
+ break;
+ case TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC:
+ return &sm->t_state.txn_conf.cache_urls_that_look_dynamic;
+ break;
+ case TS_CONFIG_HTTP_INSERT_REQUEST_VIA_STR:
+ return &sm->t_state.txn_conf.insert_request_via_string;
+ break;
+ case TS_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR:
+ return &sm->t_state.txn_conf.insert_response_via_string;
+ break;
+ case TS_CONFIG_HTTP_CACHE_HEURISTIC_MIN_LIFETIME:
+ return &sm->t_state.txn_conf.cache_heuristic_min_lifetime;
+ break;
+ case TS_CONFIG_HTTP_CACHE_HEURISTIC_MAX_LIFETIME:
+ return &sm->t_state.txn_conf.cache_heuristic_max_lifetime;
+ break;
+ case TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME:
+ return &sm->t_state.txn_conf.cache_guaranteed_min_lifetime;
+ break;
+ case TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME:
+ return &sm->t_state.txn_conf.cache_guaranteed_max_lifetime;
+ break;
+ case TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_IN:
+ return &sm->t_state.txn_conf.keep_alive_no_activity_timeout_in;
+ break;
+ case TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS:
+ return &sm->t_state.txn_conf.origin_max_connections;
+ break;
+
+ // These are "special", since they still need more attention, so fall through.
+ // This helps avoiding compiler warnings, yet detect unhandled enum members.
+ case TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR:
+ case TS_CONFIG_HTTP_RESPONSE_SERVER_STR:
+
+ case TS_CONFIG_NULL:
+ case TS_CONFIG_LAST_ENTRY:
+ return NULL;
break;
}
- return TS_SUCCESS;
+
+ return NULL;
+}
+
+/* APIs to manipulate the overridable configuration options.
+*/
+TSReturnCode
+TSHttpTxnConfigIntSet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt value)
+{
+ if (sdk_sanity_check_txn(txnp) != TS_SUCCESS)
+ return TS_ERROR;
+
+ TSMgmtInt* dest = _conf_to_memberp(conf, (HttpSM*) txnp);
+
+ if (dest) {
+ *dest = value;
+ return TS_SUCCESS;
+ }
+
+ return TS_ERROR;
}
TSReturnCode
@@ -7474,82 +7529,50 @@ TSHttpTxnConfigIntGet(TSHttpTxn txnp, TS
(sdk_sanity_check_null_ptr((void*)value) != TS_SUCCESS))
return TS_ERROR;
- HttpSM *sm = (HttpSM*) txnp;
+ TSMgmtInt* dest = _conf_to_memberp(conf, (HttpSM*) txnp);
+
+ if (dest) {
+ *value = *dest;
+ return TS_SUCCESS;
+ }
- // *value = *((MgmtInt*)(&(sm->t_state.txn_conf) + conf*sizeof(MgmtInt)));
+ return TS_ERROR;
+}
+
+// TODO: When there are more string / float configurations that are overridable,
+// we should do something similar to the Int versions (using _conf_to_memberp).
+TSReturnCode
+TSHttpTxnConfigFLoatSet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtFloat value)
+{
+ if (sdk_sanity_check_txn(txnp) != TS_SUCCESS)
+ return TS_ERROR;
+
+ HttpSM *sm = (HttpSM*) txnp;
switch (conf) {
- case TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR:
- *value = sm->t_state.txn_conf.maintain_pristine_host_hdr;
+ case TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR:
+ sm->t_state.txn_conf.cache_heuristic_lm_factor = value;
break;
- case TS_CONFIG_HTTP_CHUNKING_ENABLED:
- *value = sm->t_state.txn_conf.chunking_enabled;
- break;
- case TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED:
- *value = sm->t_state.txn_conf.negative_caching_enabled;
- break;
- case TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE:
- *value = sm->t_state.txn_conf.cache_when_to_revalidate;
- break;
- case TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED:
- *value = sm->t_state.txn_conf.keep_alive_enabled;
- break;
- case TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT:
- *value = sm->t_state.txn_conf.keep_alive_post_out;
- break;
- case TS_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT:
- *value = sm->t_state.txn_conf.sock_recv_buffer_size_out;
- break;
- case TS_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT:
- *value = sm->t_state.txn_conf.sock_send_buffer_size_out;
- break;
- case TS_CONFIG_NET_SOCK_OPTION_FLAG_OUT:
- *value = sm->t_state.txn_conf.sock_option_flag_out;
- break;
- case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_FROM:
- *value = sm->t_state.txn_conf.anonymize_remove_from;
- break;
- case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_REFERER:
- *value = sm->t_state.txn_conf.anonymize_remove_referer;
- break;
- case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT:
- *value = sm->t_state.txn_conf.anonymize_remove_user_agent;
- break;
- case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_COOKIE:
- *value = sm->t_state.txn_conf.anonymize_remove_cookie;
- break;
- case TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP:
- *value = sm->t_state.txn_conf.anonymize_remove_client_ip;
- break;
- case TS_CONFIG_HTTP_ANONYMIZE_INSERT_CLIENT_IP:
- *value = sm->t_state.txn_conf.anonymize_insert_client_ip;
- break;
- case TS_CONFIG_HTTP_APPEND_XFORWARDS_HEADER:
- *value = sm->t_state.txn_conf.append_xforwards_header;
- break;
- case TS_CONFIG_HTTP_RESPONSE_SERVER_ENABLED:
- *value = sm->t_state.txn_conf.append_xforwards_header;
- break;
- case TS_CONFIG_HTTP_INSERT_SQUID_X_FORWARDED_FOR:
- *value = sm->t_state.txn_conf.append_xforwards_header;
- break;
- case TS_CONFIG_HTTP_SEND_HTTP11_REQUESTS:
- *value = sm->t_state.txn_conf.send_http11_requests;
- break;
- case TS_CONFIG_HTTP_CACHE_HTTP:
- *value = sm->t_state.txn_conf.cache_http;
- break;
- case TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_NO_CACHE:
- *value = sm->t_state.txn_conf.cache_ignore_client_no_cache;
- break;
- case TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE:
- *value = sm->t_state.txn_conf.cache_ignore_client_cc_max_age;
- break;
- case TS_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE:
- *value = sm->t_state.txn_conf.cache_ims_on_client_no_cache;
+ default:
+ return TS_ERROR;
break;
- case TS_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE:
- *value = sm->t_state.txn_conf.cache_ignore_server_no_cache;
+ }
+
+ return TS_SUCCESS;
+}
+
+TSReturnCode
+TSHttpTxnConfigFloatGet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtFloat *value)
+{
+ if ((sdk_sanity_check_txn(txnp) != TS_SUCCESS) ||
+ (sdk_sanity_check_null_ptr((void*)value) != TS_SUCCESS))
+ return TS_ERROR;
+
+ HttpSM *sm = (HttpSM*) txnp;
+
+ switch (conf) {
+ case TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR:
+ *value = sm->t_state.txn_conf.cache_heuristic_lm_factor;
break;
default:
return TS_ERROR;
@@ -7557,6 +7580,7 @@ TSHttpTxnConfigIntGet(TSHttpTxn txnp, TS
}
return TS_SUCCESS;
+ return TS_SUCCESS;
}
TSReturnCode
@@ -7626,7 +7650,7 @@ TSHttpTxnConfigFind(const char* name, in
*conf = TS_CONFIG_NULL;
- // Lots of string comparisons here, but avoid a few at least
+ // Lots of string comparisons here, but we avoid quite a few by checking lengths
switch (length) {
case 28:
if (!strncmp(name, "proxy.config.http.cache.http", length))
@@ -7672,8 +7696,18 @@ TSHttpTxnConfigFind(const char* name, in
break;
case 40:
- if (!strncmp(name, "proxy.config.url_remap.pristine_host_hdr", length))
- *conf = TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR;
+ switch (name[length-1]) {
+ case 'r':
+ if (!strncmp(name, "proxy.config.url_remap.pristine_host_hdr", length))
+ *conf = TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR;
+ else if (!strncmp(name, "proxy.config.http.insert_request_via_str", length))
+ *conf = TS_CONFIG_HTTP_INSERT_REQUEST_VIA_STR;
+ break;
+ case 's':
+ if (!strncmp(name, "proxy.config.http.origin_max_connections", length))
+ *conf = TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS;
+ break;
+ }
break;
case 41:
@@ -7689,6 +7723,8 @@ TSHttpTxnConfigFind(const char* name, in
case 'r':
if (!strncmp(name, "proxy.config.http.append_xforwards_header", length))
*conf = TS_CONFIG_HTTP_APPEND_XFORWARDS_HEADER;
+ else if (!strncmp(name, "proxy.config.http.insert_response_via_str", length))
+ *conf = TS_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR;
break;
}
break;
@@ -7716,15 +7752,37 @@ TSHttpTxnConfigFind(const char* name, in
}
break;
+ case 43:
+ switch (name[length-1]) {
+ case 'e':
+ if (!strncmp(name, "proxy.config.http.negative_caching_lifetime", length))
+ *conf = TS_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME;
+ break;
+ case 'r':
+ if (!strncmp(name, "proxy.config.http.cache.heuristic_lm_factor", length))
+ *conf = TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR;
+ break;
+ }
+ break;
+
case 44:
if (!strncmp(name, "proxy.config.http.anonymize_remove_client_ip", length))
*conf = TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP;
else if (!strncmp(name, "proxy.config.http.anonymize_insert_client_ip", length))
*conf = TS_CONFIG_HTTP_ANONYMIZE_INSERT_CLIENT_IP;
+ break;
case 45:
- if (!strncmp(name, "proxy.config.http.anonymize_remove_user_agent", length))
- *conf = TS_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT;
+ switch (name[length-1]) {
+ case 'n':
+ if (!strncmp(name, "proxy.config.http.cache.ignore_authentication", length))
+ *conf = TS_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION;
+ break;
+ case 't':
+ if (!strncmp(name, "proxy.config.http.anonymize_remove_user_agent", length))
+ *conf = TS_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT;
+ break;
+ }
break;
case 46:
@@ -7736,6 +7794,10 @@ TSHttpTxnConfigFind(const char* name, in
*conf = TS_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE;
else if (!strncmp(name, "proxy.config.http.cache.ignore_server_no_cache", length))
*conf = TS_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE;
+ else if (!strncmp(name, "proxy.config.http.cache.heuristic_min_lifetime", length))
+ *conf = TS_CONFIG_HTTP_CACHE_HEURISTIC_MIN_LIFETIME;
+ else if (!strncmp(name, "proxy.config.http.cache.heuristic_max_lifetime", length))
+ *conf = TS_CONFIG_HTTP_CACHE_HEURISTIC_MAX_LIFETIME;
break;
case 'r':
if (!strncmp(name, "proxy.config.http.insert_squid_x_forwarded_for", length))
@@ -7744,11 +7806,33 @@ TSHttpTxnConfigFind(const char* name, in
}
break;
+ case 47:
+ if (!strncmp(name, "proxy.config.http.cache.guaranteed_min_lifetime", length))
+ *conf = TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME;
+ else if (!strncmp(name, "proxy.config.http.cache.guaranteed_max_lifetime", length))
+ *conf = TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME;
+ break;
+
case 48:
if (!strncmp(name, "proxy.config.http.cache.ignore_client_cc_max_age", length))
*conf = TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE;
break;
+ case 50:
+ if (!strncmp(name, "proxy.config.http.cache.cache_responses_to_cookies", length))
+ *conf = TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES;
+ break;
+
+ case 51:
+ if (!strncmp(name, "proxy.config.http.keep_alive_no_activity_timeout_in", length))
+ *conf = TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_IN;
+ break;
+
+ case 52:
+ if (!strncmp(name, "proxy.config.http.cache.cache_urls_that_look_dynamic", length))
+ *conf = TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC;
+ break;
+
}
return ((*conf != TS_CONFIG_NULL) ? TS_SUCCESS: TS_ERROR);
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=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/api/ts/ts.h.in (original)
+++ trafficserver/traffic/trunk/proxy/api/ts/ts.h.in Sat Jan 1 17:09:17 2011
@@ -483,12 +483,13 @@ extern "C"
typedef enum
{
- TS_CONFIG_NULL = 0,
+ TS_CONFIG_NULL = -1,
// The order of these enum's must match the order of
// struct OverridableHttpConfigParams in HttpConfig.h.
TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR,
TS_CONFIG_HTTP_CHUNKING_ENABLED,
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_POST_OUT,
@@ -510,8 +511,21 @@ extern "C"
TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE,
TS_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE,
TS_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE,
+ TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES,
+ TS_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION,
+ TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC,
+ TS_CONFIG_HTTP_INSERT_REQUEST_VIA_STR,
+ TS_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR,
+ TS_CONFIG_HTTP_CACHE_HEURISTIC_MIN_LIFETIME,
+ TS_CONFIG_HTTP_CACHE_HEURISTIC_MAX_LIFETIME,
+ TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME,
+ TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME,
+ TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_IN,
+ TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS,
+
// Strings and floats must come after all the integer configs
TS_CONFIG_HTTP_RESPONSE_SERVER_STR,
+ TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR,
TS_CONFIG_LAST_ENTRY
} TSOverridableConfigKey;
@@ -2843,11 +2857,13 @@ extern "C"
probably be done as early as possible, e.g. TS_HTTP_READ_REQUEST_HDR_HOOK.
*/
tsapi TSReturnCode TSHttpTxnConfigIntSet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt value);
- tsapi TSReturnCode TSHttpTxnConfigIntGet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt *value);
+ tsapi TSReturnCode TSHttpTxnConfigIntGet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt* value);
+ tsapi TSReturnCode TSHttpTxnConfigFloatSet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtFloat value);
+ tsapi TSReturnCode TSHttpTxnConfigFloatGet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtFloat* value);
tsapi TSReturnCode TSHttpTxnConfigStringSet(TSHttpTxn txnp, TSOverridableConfigKey conf, char* value, int length);
- tsapi TSReturnCode TSHttpTxnConfigStringGet(TSHttpTxn txnp, TSOverridableConfigKey conf, char **value, int *length);
+ tsapi TSReturnCode TSHttpTxnConfigStringGet(TSHttpTxn txnp, TSOverridableConfigKey conf, char** value, int* length);
- tsapi TSReturnCode TSHttpTxnConfigFind(const char* name, int length, TSOverridableConfigKey *conf, TSRecordDataType *type);
+ tsapi TSReturnCode TSHttpTxnConfigFind(const char* name, int length, TSOverridableConfigKey* conf, TSRecordDataType* type);
/*
It's unclear if these actually function properly still.
Modified: trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc Sat Jan 1 17:09:17 2011
@@ -614,8 +614,8 @@ HttpClientSession::release(IOBufferReade
SET_HANDLER(&HttpClientSession::state_keep_alive);
ka_vio = this->do_io_read(this, INT_MAX, read_buffer);
ink_assert(slave_ka_vio != ka_vio);
- client_vc->set_inactivity_timeout(HRTIME_SECONDS(HttpConfig::m_master.keep_alive_no_activity_timeout_in));
- client_vc->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.keep_alive_no_activity_timeout_in));
+ client_vc->set_inactivity_timeout(HRTIME_SECONDS(current_reader->t_state.txn_conf.keep_alive_no_activity_timeout_in));
+ client_vc->set_active_timeout(HRTIME_SECONDS(current_reader->t_state.txn_conf.keep_alive_no_activity_timeout_in));
}
}
Modified: trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc Sat Jan 1 17:09:17 2011
@@ -1143,7 +1143,7 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.server_max_connections, "proxy.config.http.server_max_connections");
- HttpEstablishStaticConfigLongLong(c.origin_max_connections, "proxy.config.http.origin_max_connections");
+ 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");
@@ -1163,8 +1163,8 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.enable_url_expandomatic, "proxy.config.http.enable_url_expandomatic");
- HttpEstablishStaticConfigLongLong(c.insert_request_via_string, "proxy.config.http.insert_request_via_str");
- HttpEstablishStaticConfigLongLong(c.insert_response_via_string, "proxy.config.http.insert_response_via_str");
+ HttpEstablishStaticConfigLongLong(c.oride.insert_request_via_string, "proxy.config.http.insert_request_via_str");
+ HttpEstablishStaticConfigLongLong(c.oride.insert_response_via_string, "proxy.config.http.insert_response_via_str");
HttpEstablishStaticConfigLongLong(c.verbose_via_string, "proxy.config.http.verbose_via_str");
HttpEstablishStaticConfigStringAlloc(c.proxy_request_via_string, "proxy.config.http.request_via_str");
@@ -1187,7 +1187,7 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.share_server_sessions, "proxy.config.http.share_server_sessions");
HttpEstablishStaticConfigLongLong(c.oride.keep_alive_post_out, "proxy.config.http.keep_alive_post_out");
- HttpEstablishStaticConfigLongLong(c.keep_alive_no_activity_timeout_in,
+ HttpEstablishStaticConfigLongLong(c.oride.keep_alive_no_activity_timeout_in,
"proxy.config.http.keep_alive_no_activity_timeout_in");
HttpEstablishStaticConfigLongLong(c.keep_alive_no_activity_timeout_out,
"proxy.config.http.keep_alive_no_activity_timeout_out");
@@ -1253,12 +1253,12 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.icp_enabled, "proxy.config.icp.enabled");
HttpEstablishStaticConfigLongLong(c.stale_icp_enabled, "proxy.config.icp.stale_icp_enabled");
- HttpEstablishStaticConfigLongLong(c.cache_heuristic_min_lifetime, "proxy.config.http.cache.heuristic_min_lifetime");
- HttpEstablishStaticConfigLongLong(c.cache_heuristic_max_lifetime, "proxy.config.http.cache.heuristic_max_lifetime");
- HttpEstablishStaticConfigFloat(c.cache_heuristic_lm_factor, "proxy.config.http.cache.heuristic_lm_factor");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_heuristic_min_lifetime, "proxy.config.http.cache.heuristic_min_lifetime");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_heuristic_max_lifetime, "proxy.config.http.cache.heuristic_max_lifetime");
+ HttpEstablishStaticConfigFloat(c.oride.cache_heuristic_lm_factor, "proxy.config.http.cache.heuristic_lm_factor");
- HttpEstablishStaticConfigLongLong(c.cache_guaranteed_min_lifetime, "proxy.config.http.cache.guaranteed_min_lifetime");
- HttpEstablishStaticConfigLongLong(c.cache_guaranteed_max_lifetime, "proxy.config.http.cache.guaranteed_max_lifetime");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_guaranteed_min_lifetime, "proxy.config.http.cache.guaranteed_min_lifetime");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_guaranteed_max_lifetime, "proxy.config.http.cache.guaranteed_max_lifetime");
HttpEstablishStaticConfigLongLong(c.cache_max_stale_age, "proxy.config.http.cache.max_stale_age");
@@ -1284,10 +1284,10 @@ HttpConfig::startup()
"proxy.config.http.cache.ignore_client_cc_max_age");
HttpEstablishStaticConfigLongLong(c.oride.cache_ims_on_client_no_cache, "proxy.config.http.cache.ims_on_client_no_cache");
HttpEstablishStaticConfigLongLong(c.oride.cache_ignore_server_no_cache, "proxy.config.http.cache.ignore_server_no_cache");
- HttpEstablishStaticConfigLongLong(c.cache_responses_to_cookies, "proxy.config.http.cache.cache_responses_to_cookies");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_responses_to_cookies, "proxy.config.http.cache.cache_responses_to_cookies");
- HttpEstablishStaticConfigLongLong(c.cache_ignore_auth, "proxy.config.http.cache.ignore_authentication");
- HttpEstablishStaticConfigLongLong(c.cache_urls_that_look_dynamic,
+ HttpEstablishStaticConfigLongLong(c.oride.cache_ignore_auth, "proxy.config.http.cache.ignore_authentication");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_urls_that_look_dynamic,
"proxy.config.http.cache.cache_urls_that_look_dynamic");
HttpEstablishStaticConfigLongLong(c.cache_enable_default_vary_headers,
"proxy.config.http.cache.enable_default_vary_headers");
@@ -1358,7 +1358,7 @@ HttpConfig::startup()
// Negative response caching
HttpEstablishStaticConfigLongLong(c.oride.negative_caching_enabled, "proxy.config.http.negative_caching_enabled");
- HttpEstablishStaticConfigLongLong(c.negative_caching_lifetime, "proxy.config.http.negative_caching_lifetime");
+ HttpEstablishStaticConfigLongLong(c.oride.negative_caching_lifetime, "proxy.config.http.negative_caching_lifetime");
// InktoSwitch
HttpEstablishStaticConfigLongLong(c.inktoswitch_enabled, "proxy.config.http.inktoswitch_enabled");
@@ -1474,25 +1474,21 @@ HttpConfig::reconfigure()
params->disable_ssl_parenting = m_master.disable_ssl_parenting;
params->server_max_connections = m_master.server_max_connections;
-
- params->origin_max_connections = m_master.origin_max_connections;
-
+ params->oride.origin_max_connections = m_master.oride.origin_max_connections;
params->origin_min_keep_alive_connections = m_master.origin_min_keep_alive_connections;
- if( params->origin_max_connections &&
- params->origin_max_connections < params->origin_min_keep_alive_connections ) {
+ 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");
- params->origin_min_keep_alive_connections = params->origin_max_connections;
+ params->origin_min_keep_alive_connections = params->oride.origin_max_connections;
}
params->parent_proxy_routing_enable = INT_TO_BOOL(m_master.parent_proxy_routing_enable);
-
params->fwd_proxy_auth_to_parent = 0;
-
params->enable_url_expandomatic = INT_TO_BOOL(m_master.enable_url_expandomatic);
- params->insert_request_via_string = INT_TO_BOOL(m_master.insert_request_via_string);
- params->insert_response_via_string = INT_TO_BOOL(m_master.insert_response_via_string);
+ params->oride.insert_request_via_string = INT_TO_BOOL(m_master.oride.insert_request_via_string);
+ params->oride.insert_response_via_string = INT_TO_BOOL(m_master.oride.insert_response_via_string);
params->verbose_via_string = m_master.verbose_via_string;
params->proxy_request_via_string = xstrdup(m_master.proxy_request_via_string);
params->proxy_request_via_string_len = (params->proxy_request_via_string) ? strlen(params->proxy_request_via_string) : 0;
@@ -1515,7 +1511,7 @@ HttpConfig::reconfigure()
params->share_server_sessions = INT_TO_BOOL(m_master.share_server_sessions);
params->oride.keep_alive_post_out = m_master.oride.keep_alive_post_out;
- params->keep_alive_no_activity_timeout_in = m_master.keep_alive_no_activity_timeout_in;
+ params->oride.keep_alive_no_activity_timeout_in = m_master.oride.keep_alive_no_activity_timeout_in;
params->keep_alive_no_activity_timeout_out = m_master.keep_alive_no_activity_timeout_out;
params->transaction_no_activity_timeout_in = m_master.transaction_no_activity_timeout_in;
params->transaction_no_activity_timeout_out = m_master.transaction_no_activity_timeout_out;
@@ -1565,12 +1561,12 @@ HttpConfig::reconfigure()
params->icp_enabled = (m_master.icp_enabled == ICP_MODE_SEND_RECEIVE ? 1 : 0);
params->stale_icp_enabled = m_master.stale_icp_enabled;
- params->cache_heuristic_min_lifetime = m_master.cache_heuristic_min_lifetime;
- params->cache_heuristic_max_lifetime = m_master.cache_heuristic_max_lifetime;
- params->cache_heuristic_lm_factor = min(max(m_master.cache_heuristic_lm_factor, 0), 1);
+ params->oride.cache_heuristic_min_lifetime = m_master.oride.cache_heuristic_min_lifetime;
+ params->oride.cache_heuristic_max_lifetime = m_master.oride.cache_heuristic_max_lifetime;
+ params->oride.cache_heuristic_lm_factor = min(max(m_master.oride.cache_heuristic_lm_factor, 0), 1);
- params->cache_guaranteed_min_lifetime = m_master.cache_guaranteed_min_lifetime;
- params->cache_guaranteed_max_lifetime = m_master.cache_guaranteed_max_lifetime;
+ params->oride.cache_guaranteed_min_lifetime = m_master.oride.cache_guaranteed_min_lifetime;
+ params->oride.cache_guaranteed_max_lifetime = m_master.oride.cache_guaranteed_max_lifetime;
params->cache_max_stale_age = m_master.cache_max_stale_age;
params->freshness_fuzz_time = m_master.freshness_fuzz_time;
@@ -1598,9 +1594,9 @@ HttpConfig::reconfigure()
params->oride.cache_ignore_client_cc_max_age = INT_TO_BOOL(m_master.oride.cache_ignore_client_cc_max_age);
params->oride.cache_ims_on_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ims_on_client_no_cache);
params->oride.cache_ignore_server_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_server_no_cache);
- params->cache_responses_to_cookies = m_master.cache_responses_to_cookies;
- params->cache_ignore_auth = INT_TO_BOOL(m_master.cache_ignore_auth);
- params->cache_urls_that_look_dynamic = INT_TO_BOOL(m_master.cache_urls_that_look_dynamic);
+ params->oride.cache_responses_to_cookies = m_master.oride.cache_responses_to_cookies;
+ params->oride.cache_ignore_auth = INT_TO_BOOL(m_master.oride.cache_ignore_auth);
+ params->oride.cache_urls_that_look_dynamic = INT_TO_BOOL(m_master.oride.cache_urls_that_look_dynamic);
params->cache_enable_default_vary_headers = INT_TO_BOOL(m_master.cache_enable_default_vary_headers);
params->ignore_accept_mismatch = INT_TO_BOOL(m_master.ignore_accept_mismatch);
@@ -1652,7 +1648,7 @@ HttpConfig::reconfigure()
params->negative_revalidating_lifetime = m_master.negative_revalidating_lifetime;
params->oride.negative_caching_enabled = m_master.oride.negative_caching_enabled;
- params->negative_caching_lifetime = m_master.negative_caching_lifetime;
+ params->oride.negative_caching_lifetime = m_master.oride.negative_caching_lifetime;
params->inktoswitch_enabled = m_master.inktoswitch_enabled;
params->router_ip = m_master.router_ip;
Modified: trafficserver/traffic/trunk/proxy/http2/HttpConfig.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpConfig.h?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpConfig.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpConfig.h Sat Jan 1 17:09:17 2011
@@ -407,7 +407,8 @@ struct HttpConfigPortRange
// to be overridable per transaction more easily.
struct OverridableHttpConfigParams {
OverridableHttpConfigParams()
- : maintain_pristine_host_hdr(0), chunking_enabled(0), negative_caching_enabled(0),
+ : 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),
sock_recv_buffer_size_out(0), sock_send_buffer_size_out(0), sock_option_flag_out(0),
anonymize_remove_from(false), anonymize_remove_referer(false), anonymize_remove_user_agent(false),
@@ -415,19 +416,31 @@ struct OverridableHttpConfigParams {
append_xforwards_header(false), proxy_response_server_enabled(0),
insert_squid_x_forwarded_for(0), send_http11_requests(3), // SEND_HTTP11_IF_REQUEST_11_AND_HOSTDB
cache_http(false), cache_ignore_client_no_cache(false), cache_ignore_client_cc_max_age(true),
- cache_ims_on_client_no_cache(false), cache_ignore_server_no_cache(false),
+ cache_ims_on_client_no_cache(false), cache_ignore_server_no_cache(false), cache_responses_to_cookies(0),
+ cache_ignore_auth(0), cache_urls_that_look_dynamic(false),
+ insert_request_via_string(0), insert_response_via_string(0),
+ cache_heuristic_min_lifetime(0), cache_heuristic_max_lifetime(0),
+ cache_guaranteed_min_lifetime(0), cache_guaranteed_max_lifetime(0),
+ keep_alive_no_activity_timeout_in(0),
+ origin_max_connections(0),
// Strings / floats must come last
- proxy_response_server_string(NULL), proxy_response_server_string_len(0)
+ proxy_response_server_string(NULL), proxy_response_server_string_len(0),
+ cache_heuristic_lm_factor(0)
{}
// IMPORTANT: All MgmtInt configs should come before any other string / float
// configs!!!
- // These three configs used to be @-parameters in remap.config
+ // The first three configs used to be @-parameters in remap.config
MgmtInt maintain_pristine_host_hdr;
MgmtInt chunking_enabled;
+
+ ////////////////////////////////
+ // Negative Response Caching //
+ ////////////////////////////////
MgmtInt negative_caching_enabled;
+ MgmtInt negative_caching_lifetime;
MgmtInt cache_when_to_revalidate;
@@ -472,6 +485,26 @@ struct OverridableHttpConfigParams {
MgmtInt cache_ignore_client_cc_max_age;
MgmtInt cache_ims_on_client_no_cache;
MgmtInt cache_ignore_server_no_cache;
+ MgmtInt cache_responses_to_cookies;
+ MgmtInt cache_ignore_auth;
+ MgmtInt cache_urls_that_look_dynamic;
+
+ MgmtInt insert_request_via_string;
+ MgmtInt insert_response_via_string;
+
+ /////////////////////
+ // cache variables //
+ /////////////////////
+ MgmtInt cache_heuristic_min_lifetime;
+ MgmtInt cache_heuristic_max_lifetime;
+ MgmtInt cache_guaranteed_min_lifetime;
+ MgmtInt cache_guaranteed_max_lifetime;
+
+ ///////////////////////////////////////////////////
+ // connection variables. timeouts are in seconds //
+ ///////////////////////////////////////////////////
+ MgmtInt keep_alive_no_activity_timeout_in;
+ MgmtInt origin_max_connections;
// IMPORTANT: Here comes all strings / floats configs.
@@ -480,6 +513,8 @@ struct OverridableHttpConfigParams {
///////////////////////////////////////////////////////////////////
char *proxy_response_server_string; // This does not get free'd by us!
size_t proxy_response_server_string_len; // Updated when server_string is set.
+
+ float cache_heuristic_lm_factor;
};
@@ -522,8 +557,7 @@ public:
unsigned int outgoing_ip_to_bind_saddr;
MgmtInt server_max_connections;
- MgmtInt origin_max_connections;
- MgmtInt origin_min_keep_alive_connections;
+ MgmtInt origin_min_keep_alive_connections; // TODO: This one really ought to be overridable, but difficult right now.
MgmtInt parent_proxy_routing_enable;
MgmtInt disable_ssl_parenting;
@@ -536,8 +570,6 @@ public:
MgmtInt snarf_username_from_authorization;
- MgmtInt insert_request_via_string;
- MgmtInt insert_response_via_string;
MgmtInt verbose_via_string;
char *proxy_request_via_string;
@@ -567,7 +599,6 @@ public:
MgmtInt origin_server_pipeline;
MgmtInt user_agent_pipeline;
MgmtInt share_server_sessions;
- MgmtInt keep_alive_no_activity_timeout_in;
MgmtInt keep_alive_no_activity_timeout_out;
MgmtInt transaction_no_activity_timeout_in;
MgmtInt transaction_no_activity_timeout_out;
@@ -613,16 +644,6 @@ public:
MgmtInt icp_enabled;
MgmtInt stale_icp_enabled;
- /////////////////////
- // cache variables //
- /////////////////////
- MgmtInt cache_heuristic_min_lifetime;
- MgmtInt cache_heuristic_max_lifetime;
- float cache_heuristic_lm_factor;
-
- MgmtInt cache_guaranteed_min_lifetime;
- MgmtInt cache_guaranteed_max_lifetime;
-
MgmtInt cache_max_stale_age;
MgmtInt freshness_fuzz_time;
@@ -644,9 +665,6 @@ public:
///////////////////
// cache control //
///////////////////
- MgmtInt cache_responses_to_cookies;
- MgmtInt cache_ignore_auth;
- MgmtInt cache_urls_that_look_dynamic;
MgmtInt cache_enable_default_vary_headers;
MgmtInt cache_when_to_add_no_cache_to_msie_requests;
MgmtInt cache_required_headers;
@@ -669,7 +687,6 @@ public:
//////////
MgmtInt push_method_enabled;
-
////////////////////////////
// HTTP Referer filtering //
////////////////////////////
@@ -715,11 +732,6 @@ public:
MgmtInt negative_revalidating_enabled;
MgmtInt negative_revalidating_lifetime;
- ////////////////////////////////
- // Negative Response Caching //
- ////////////////////////////////
- MgmtInt negative_caching_lifetime;
-
/////////////////
// Inktoswitch //
/////////////////
@@ -907,7 +919,6 @@ HttpConfigParams::HttpConfigParams()
outgoing_ip_to_bind(0),
outgoing_ip_to_bind_saddr(0),
server_max_connections(0),
- origin_max_connections(0),
origin_min_keep_alive_connections(0),
parent_proxy_routing_enable(false),
disable_ssl_parenting(0),
@@ -917,8 +928,6 @@ HttpConfigParams::HttpConfigParams()
no_origin_server_dns(0),
use_client_target_addr(0),
//snarf_username_from_authorization(0),
- insert_request_via_string(0),
- insert_response_via_string(0),
verbose_via_string(0),
proxy_request_via_string(0),
proxy_request_via_string_len(0),
@@ -935,7 +944,6 @@ HttpConfigParams::HttpConfigParams()
origin_server_pipeline(0),
user_agent_pipeline(0),
share_server_sessions(0),
- keep_alive_no_activity_timeout_in(0),
keep_alive_no_activity_timeout_out(0),
transaction_no_activity_timeout_in(0),
transaction_no_activity_timeout_out(0),
@@ -960,11 +968,6 @@ HttpConfigParams::HttpConfigParams()
enable_http_stats(1),
icp_enabled(0),
stale_icp_enabled(0),
- cache_heuristic_min_lifetime(0),
- cache_heuristic_max_lifetime(0),
- cache_heuristic_lm_factor(0),
- cache_guaranteed_min_lifetime(0),
- cache_guaranteed_max_lifetime(0),
cache_max_stale_age(0),
freshness_fuzz_time(0),
freshness_fuzz_min_time(0),
@@ -976,9 +979,6 @@ HttpConfigParams::HttpConfigParams()
cache_open_read_retry_time(0),
max_cache_open_write_retries(0),
cache_open_write_retry_time(0),
- cache_responses_to_cookies(0),
- cache_ignore_auth(0),
- cache_urls_that_look_dynamic(false),
cache_enable_default_vary_headers(false),
cache_when_to_add_no_cache_to_msie_requests(0),
cache_required_headers(CACHE_REQUIRED_HEADERS_NONE),
@@ -996,7 +996,6 @@ HttpConfigParams::HttpConfigParams()
client_abort_threshold(0),
negative_revalidating_enabled(0),
negative_revalidating_lifetime(0),
- negative_caching_lifetime(0),
inktoswitch_enabled(0),
router_ip(0),
router_port(0),
Modified: trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSM.cc?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSM.cc Sat Jan 1 17:09:17 2011
@@ -1691,10 +1691,9 @@ HttpSM::state_http_server_open(int event
// of connections per host. Set enable_origin_connection_limiting
// to true in the server session so it will increment and decrement
// the connection count.
- if (t_state.http_config_param->origin_max_connections > 0 ||
+ if (t_state.txn_conf.origin_max_connections > 0 ||
t_state.http_config_param->origin_min_keep_alive_connections > 0) {
- Debug("http_ss", "[%" PRId64 "] max number of connections: %u",
- sm_id, t_state.http_config_param->origin_max_connections);
+ Debug("http_ss", "[%" PRId64 "] max number of connections: %u", sm_id, t_state.txn_conf.origin_max_connections);
session->enable_origin_connection_limiting = true;
}
/*UnixNetVConnection * vc = (UnixNetVConnection*)(ua_session->client_vc);
@@ -2948,12 +2947,12 @@ HttpSM::tunnel_handler_server(int event,
// to so the next ka request can use it. We bind privately to the
// client to add some degree of affinity to the system. However,
// we turn off private binding when outbound conenctions are being
- // limit since it makes it too expense to initiate a purge of idle
+ // limit since it makes it too expensive to initiate a purge of idle
// server keep-alive sessions
if (ua_session &&
t_state.client_info.keep_alive == HTTP_KEEPALIVE &&
t_state.http_config_param->server_max_connections <= 0 &&
- t_state.http_config_param->origin_max_connections <= 0) {
+ t_state.txn_conf.origin_max_connections <= 0) {
ua_session->attach_server_session(server_session);
} else {
// Release the session back into the shared session pool
@@ -4302,9 +4301,10 @@ HttpSM::do_http_server_open(bool raw)
}
// Check to see if we have reached the max number of connections on this
// host.
- if (t_state.http_config_param->origin_max_connections > 0) {
+ if (t_state.txn_conf.origin_max_connections > 0) {
ConnectionCount *connections = ConnectionCount::getInstance();
- if (connections->getCount((t_state.current.server->ip)) >= t_state.http_config_param->origin_max_connections) {
+
+ if (connections->getCount((t_state.current.server->ip)) >= t_state.txn_conf.origin_max_connections) {
Debug("http", "[%" PRId64 "] over the number of connection for this host: %u", sm_id, t_state.current.server->ip);
ink_debug_assert(pending_action == NULL);
pending_action = eventProcessor.schedule_in(this, HRTIME_MSECONDS(100));
Modified: trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc?rev=1054258&r1=1054257&r2=1054258&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSessionManager.cc Sat Jan 1 17:09:17 2011
@@ -74,10 +74,14 @@ SessionBucket::session_handler(int event
return 0;
}
- // Search the 2nd level bucket for apprpropriate netvc
+ // Search the 2nd level bucket for appropriate netvc
int l2_index = SECOND_LEVEL_HASH(net_vc->get_remote_ip());
+ HttpConfigParams *http_config_params = HttpConfig::acquire();
+ bool found = false;
+
ink_assert(l2_index < HSM_LEVEL2_BUCKETS);
s = l2_hash[l2_index].head;
+
while (s != NULL) {
if (s->get_netvc() == net_vc) {
@@ -85,41 +89,42 @@ SessionBucket::session_handler(int event
// keeping the connection alive will not keep us above the # of max connections
// to the origin and we are below the min number of keep alive connections to this
// origin, then reset the timeouts on our end and do not close the connection
- if( (event == VC_EVENT_INACTIVITY_TIMEOUT || event == VC_EVENT_ACTIVE_TIMEOUT) &&
- s->state == HSS_KA_SHARED &&
- s->enable_origin_connection_limiting ) {
+ if ((event == VC_EVENT_INACTIVITY_TIMEOUT || event == VC_EVENT_ACTIVE_TIMEOUT) &&
+ s->state == HSS_KA_SHARED &&
+ s->enable_origin_connection_limiting) {
- HttpConfigParams *http_config_params = HttpConfig::acquire();
bool connection_count_below_min = s->connection_count->getCount(s->server_ip) <= http_config_params->origin_min_keep_alive_connections;
- HttpConfig::release(http_config_params);
- if( connection_count_below_min ) {
+ if (connection_count_below_min) {
Debug("http_ss", "[%" PRId64 "] [session_bucket] session received io notice [%s], "
"reseting timeout to maintain minimum number of connections", s->con_id,
HttpDebugNames::get_event_name(event));
- s->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(
- HttpConfig::m_master.keep_alive_no_activity_timeout_out));
- s->get_netvc()->set_active_timeout(HRTIME_SECONDS(
- HttpConfig::m_master.keep_alive_no_activity_timeout_out));
- return 0;
+ s->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(http_config_params->keep_alive_no_activity_timeout_out));
+ s->get_netvc()->set_active_timeout(HRTIME_SECONDS(http_config_params->keep_alive_no_activity_timeout_out));
+ found = true;
+ break;
}
}
-
// We've found our server session. Remove it from
// our lists and close it down
- Debug("http_ss", "[%" PRId64 "] [session_bucket] session received "
- "io notice [%s]", s->con_id, HttpDebugNames::get_event_name(event));
+ Debug("http_ss", "[%" PRId64 "] [session_bucket] session received io notice [%s]",
+ s->con_id, HttpDebugNames::get_event_name(event));
ink_assert(s->state == HSS_KA_SHARED);
lru_list.remove(s);
l2_hash[l2_index].remove(s);
s->do_io_close();
- return 0;
+ found = true;
+ break;
} else {
s = s->hash_link.next;
}
}
+ HttpConfig::release(http_config_params);
+ if (found)
+ return 0;
+
// We failed to find our session. This can only be the result
// of a programming flaw
Warning("Connection leak from http keep-alive system");