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 2013/08/03 22:51:40 UTC
[31/52] [abbrv] git commit: TS-1255 Added accept-encoding filter to
overridable configs
TS-1255 Added accept-encoding filter to overridable configs
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/73b277f6
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/73b277f6
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/73b277f6
Branch: refs/heads/3.3.x
Commit: 73b277f6dc56fc61c27e56c14266e60091e48637
Parents: ec65b11
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Jul 29 00:26:42 2013 +0200
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Aug 1 22:42:49 2013 +0200
----------------------------------------------------------------------
proxy/InkAPI.cc | 8 ++++++++
proxy/InkAPITest.cc | 3 ++-
proxy/api/ts/ts.h.in | 1 +
proxy/http/HttpConfig.cc | 2 +-
proxy/http/HttpConfig.h | 14 +++++---------
proxy/http/HttpTransact.cc | 2 +-
6 files changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73b277f6/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 63001f2..5b3e728 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -7593,6 +7593,10 @@ _conf_to_memberp(TSOverridableConfigKey conf, HttpSM* sm, OverridableDataType *t
typ = OVERRIDABLE_TYPE_INT;
ret = &sm->t_state.txn_conf->negative_revalidating_lifetime;
break;
+ case TS_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED:
+ typ = OVERRIDABLE_TYPE_INT;
+ ret = &sm->t_state.txn_conf->accept_encoding_filter_enabled;
+ break;
// This helps avoiding compiler warnings, yet detect unhandled enum members.
case TS_CONFIG_NULL:
@@ -8052,6 +8056,10 @@ TSHttpTxnConfigFind(const char* name, int length, TSOverridableConfigKey *conf,
case 48:
switch (name[length-1]) {
+ case 'd':
+ if (!strncmp(name, "proxy.config.http.accept_encoding_filter_enabled", length))
+ cnf = TS_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED;
+ break;
case 'e':
if (!strncmp(name, "proxy.config.http.cache.ignore_client_cc_max_age", length))
cnf = TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73b277f6/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 108a125..f9a0f83 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7403,7 +7403,8 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
"proxy.config.http.request_header_max_size",
"proxy.config.http.response_header_max_size",
"proxy.config.http.negative_revalidating_enabled",
- "proxy.config.http.negative_revalidating_lifetime"
+ "proxy.config.http.negative_revalidating_lifetime",
+ "proxy.config.http.accept_encoding_filter_enabled"
};
REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS) (RegressionTest * test, int /* atype ATS_UNUSED */, int *pstatus)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73b277f6/proxy/api/ts/ts.h.in
----------------------------------------------------------------------
diff --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in
index 4b34bd8..3379a26 100644
--- a/proxy/api/ts/ts.h.in
+++ b/proxy/api/ts/ts.h.in
@@ -679,6 +679,7 @@ extern "C"
TS_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE,
TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED,
TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME,
+ TS_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED,
TS_CONFIG_LAST_ENTRY
} TSOverridableConfigKey;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73b277f6/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 1f7c478..461a9b7 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1581,7 +1581,7 @@ params->push_method_enabled = INT_TO_BOOL(m_master.push_method_enabled);
params->referer_filter_enabled = INT_TO_BOOL(m_master.referer_filter_enabled);
params->referer_format_redirect = INT_TO_BOOL(m_master.referer_format_redirect);
- params->accept_encoding_filter_enabled = INT_TO_BOOL(m_master.accept_encoding_filter_enabled);
+ params->oride.accept_encoding_filter_enabled = INT_TO_BOOL(m_master.oride.accept_encoding_filter_enabled);
params->oride.down_server_timeout = m_master.oride.down_server_timeout;
params->oride.client_abort_threshold = m_master.oride.client_abort_threshold;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73b277f6/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index d4970e5..c220463 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -506,6 +506,11 @@ struct OverridableHttpConfigParams {
MgmtByte doc_in_cache_skip_dns;
MgmtByte flow_control_enabled;
+ ////////////////////////////////////////////////////////
+ // HTTP Accept-Encoding filtering based on User-Agent //
+ ////////////////////////////////////////////////////////
+ MgmtByte accept_encoding_filter_enabled;
+
////////////////////////////////
// Optimize gzip alternates //
////////////////////////////////
@@ -565,9 +570,6 @@ struct OverridableHttpConfigParams {
MgmtInt connect_attempts_timeout;
MgmtInt post_connect_attempts_timeout;
- ////////////////////////
- // Negative Caching //
- ////////////////////////
MgmtInt down_server_timeout;
MgmtInt client_abort_threshold;
@@ -726,11 +728,6 @@ public:
MgmtByte referer_filter_enabled;
MgmtByte referer_format_redirect;
- ////////////////////////////////////////////////////////
- // HTTP Accept-Encoding filtering based on User-Agent //
- ////////////////////////////////////////////////////////
- MgmtByte accept_encoding_filter_enabled;
-
//////////////////
// Transparency //
//////////////////
@@ -927,7 +924,6 @@ HttpConfigParams::HttpConfigParams()
push_method_enabled(0),
referer_filter_enabled(0),
referer_format_redirect(0),
- accept_encoding_filter_enabled(0),
client_transparency_enabled(false),
server_transparency_enabled(false),
reverse_proxy_enabled(0),
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73b277f6/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index a39447e..42e0b38 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -1072,7 +1072,7 @@ HttpTransact::ModifyRequest(State* s)
/////////////////////////////////////////////////////////
// Modify Accept-Encoding for several specific User-Agent
/////////////////////////////////////////////////////////
- if (s->http_config_param->accept_encoding_filter_enabled) {
+ if (s->txn_conf->accept_encoding_filter_enabled) {
perform_accept_encoding_filtering(s);
}