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:03 UTC
svn commit: r1054255 - in /trafficserver/traffic/trunk: ./ plugins/
plugins/conf_remap/ proxy/ proxy/api/ts/ proxy/http2/ proxy/http2/remap/
Author: zwoop
Date: Sat Jan 1 17:09:03 2011
New Revision: 1054255
URL: http://svn.apache.org/viewvc?rev=1054255&view=rev
Log:
TS-599 First cut at new APIs, and a remap plugin
Also cleaned up / added suggestions from amc.
Added:
trafficserver/traffic/trunk/plugins/
trafficserver/traffic/trunk/plugins/Makefile.am
trafficserver/traffic/trunk/plugins/conf_remap/
trafficserver/traffic/trunk/plugins/conf_remap/Makefile.am
trafficserver/traffic/trunk/plugins/conf_remap/conf_remap.cc
Modified:
trafficserver/traffic/trunk/Makefile.am
trafficserver/traffic/trunk/configure.ac
trafficserver/traffic/trunk/proxy/InkAPI.cc
trafficserver/traffic/trunk/proxy/ReverseProxy.cc
trafficserver/traffic/trunk/proxy/api/ts/ts.h.in
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/HttpTransact.cc
trafficserver/traffic/trunk/proxy/http2/HttpTransact.h
trafficserver/traffic/trunk/proxy/http2/remap/RemapPluginInfo.h
trafficserver/traffic/trunk/proxy/http2/remap/RemapPlugins.cc
trafficserver/traffic/trunk/proxy/http2/remap/RemapProcessor.cc
trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.cc
trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.h
trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.cc
trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.h
Modified: trafficserver/traffic/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/Makefile.am?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/Makefile.am (original)
+++ trafficserver/traffic/trunk/Makefile.am Sat Jan 1 17:09:03 2011
@@ -24,9 +24,9 @@ ACLOCAL_AMFLAGS = -I build
# proxy/api/ts has to be built first, since so much of libraries and "core
# depends on the generates ts/ts.h include file.
if STANDALONE_IOCORE
-SUBDIRS = proxy/api/ts iocore lib @hdr_dirs@ proxy
+SUBDIRS = proxy/api/ts iocore lib @hdr_dirs@ proxy plugins
else
-SUBDIRS = proxy/api/ts iocore lib proxy rc doc
+SUBDIRS = proxy/api/ts iocore lib proxy rc doc plugins
endif
DIST_BUILD_USER=`id -nu`
Modified: trafficserver/traffic/trunk/configure.ac
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/configure.ac?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/configure.ac (original)
+++ trafficserver/traffic/trunk/configure.ac Sat Jan 1 17:09:03 2011
@@ -43,6 +43,8 @@ AC_CONFIG_MACRO_DIR([build])
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-installinfo no-installman 1.9.2])
AM_CONFIG_HEADER([lib/ts/ink_autoconf.h])
+LT_INIT([dlopen])
+
# Libtool versioning uses different conventions on different
# platforms. At least on FreeBSD, libtool uses an overly complex
# convention that attempts to solve problems that most people just
@@ -1286,8 +1288,11 @@ AC_CONFIG_FILES([proxy/mgmt2/web2/Makefi
AC_CONFIG_FILES([proxy/stats/Makefile])
AC_CONFIG_FILES([proxy/wccp/Makefile])
AC_CONFIG_FILES([proxy/api/ts/Makefile])
-AC_CONFIG_FILES([example/Makefile])
+# production plugins
+AC_CONFIG_FILES([plugins/Makefile])
+AC_CONFIG_FILES([plugins/conf_remap/Makefile])
# example plugins
+AC_CONFIG_FILES([example/Makefile])
AC_CONFIG_FILES([example/add-header/Makefile])
AC_CONFIG_FILES([example/append-transform/Makefile])
AC_CONFIG_FILES([example/basic-auth/Makefile])
Added: trafficserver/traffic/trunk/plugins/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/plugins/Makefile.am?rev=1054255&view=auto
==============================================================================
--- trafficserver/traffic/trunk/plugins/Makefile.am (added)
+++ trafficserver/traffic/trunk/plugins/Makefile.am Sat Jan 1 17:09:03 2011
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SUBDIRS = conf_remap
Added: trafficserver/traffic/trunk/plugins/conf_remap/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/plugins/conf_remap/Makefile.am?rev=1054255&view=auto
==============================================================================
--- trafficserver/traffic/trunk/plugins/conf_remap/Makefile.am (added)
+++ trafficserver/traffic/trunk/plugins/conf_remap/Makefile.am Sat Jan 1 17:09:03 2011
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+CXXFLAGS+=-I$(top_srcdir)/proxy/api
+
+pkglibdir = ${pkglibexecdir}
+pkglib_LTLIBRARIES = conf_remap.la
+conf_remap_la_SOURCES = conf_remap.cc
+conf_remap_la_LDFLAGS = -module -avoid-version -shared
Added: trafficserver/traffic/trunk/plugins/conf_remap/conf_remap.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/plugins/conf_remap/conf_remap.cc?rev=1054255&view=auto
==============================================================================
--- trafficserver/traffic/trunk/plugins/conf_remap/conf_remap.cc (added)
+++ trafficserver/traffic/trunk/plugins/conf_remap/conf_remap.cc Sat Jan 1 17:09:03 2011
@@ -0,0 +1,278 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include <ts/ts.h>
+#include <ts/remap.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+static const char* PLUGIN_NAME = "conf_remap";
+// This makes the plugin depend on the version of traffic server installed, but that's
+// OK, since this plugin is distributed only with the "core" (it's a core piece).
+#define MAX_OVERRIDABLE_CONFIGS TS_CONFIG_LAST_ENTRY
+
+
+// Class to hold a set of configurations (one for each remap rule instance)
+struct RemapConfigs
+{
+ struct Item {
+ TSOverridableConfigKey _name;
+ TSRecordDataType _type;
+ TSRecordData _data;
+ };
+
+ RemapConfigs()
+ : _current(0)
+ {
+ memset(_items, 0, sizeof(_items));
+ };
+
+ bool parse_file(const char *fn);
+
+ Item _items[MAX_OVERRIDABLE_CONFIGS];
+ int _current;
+};
+
+// Helper functionfor the parser
+inline TSRecordDataType
+str_to_datatype(const char* str)
+{
+ TSRecordDataType type = TS_RECORDDATATYPE_NULL;
+
+ if (!str || !*str)
+ return TS_RECORDDATATYPE_NULL;
+
+ if (!strcmp(str, "INT")) {
+ type = TS_RECORDDATATYPE_INT;
+ } else if (!strcmp(str, "STRING")) {
+ type = TS_RECORDDATATYPE_STRING;
+ }
+
+ return type;
+}
+
+// Config file parser, somewhat borrowed from P_RecCore.i
+bool
+RemapConfigs::parse_file(const char* fn)
+{
+ int line_num = 0;
+ TSFile file;
+ char buf[8192];
+ TSOverridableConfigKey name;
+ TSRecordDataType type, expected_type;
+
+ if (!fn || ('\0' == *fn))
+ return false;
+
+ if (NULL == (file = TSfopen(fn, "r"))) {
+ TSError("conf_remap: could not open config file %s", fn);
+ return false;
+ }
+
+ while (NULL != TSfgets(file, buf, sizeof(buf))) {
+ char *ln, *tok;
+ char *s = buf;
+
+ ++line_num; // First line is #1 ...
+ while (isspace(*s))
+ ++s;
+ tok = strtok_r(s, " \t", &ln);
+
+ // check for blank lines and comments
+ if ((!tok) || (tok && ('#' == *tok)))
+ continue;
+
+ if (strncmp(tok, "CONFIG", 6)) {
+ TSError("conf_remap: file %s, line %d: non-CONFIG line encountered", fn, line_num);
+ continue;
+ }
+
+ // Find the configuration name
+ tok = strtok_r(NULL, " \t", &ln);
+ if (TSHttpTxnConfigFind(tok, -1, &name, &expected_type) != TS_SUCCESS) {
+ TSError("conf_remap: file %s, line %d: no records.config name given", fn, line_num);
+ continue;
+ }
+
+ // Find the type (INT or STRING only)
+ tok = strtok_r(NULL, " \t", &ln);
+ if (TS_RECORDDATATYPE_NULL == (type = str_to_datatype(tok))) {
+ TSError("conf_remap: file %s, line %d: only INT and STRING types supported", fn, line_num);
+ continue;
+ }
+
+ if (type != expected_type) {
+ TSError("conf_remap: file %s, line %d: mismatch between provide data type, and expected type", fn, line_num);
+ continue;
+ }
+
+ // Find the value (which depends on the type above)
+ if (ln) {
+ while (isspace(*ln))
+ ++ln;
+ if ('\0' == *ln) {
+ tok = NULL;
+ } else {
+ tok = ln;
+ while (*ln != '\0')
+ ++ln;
+ --ln;
+ while (isspace(*ln) && (ln > tok))
+ --ln;
+ ++ln;
+ *ln = '\0';
+ }
+ } else {
+ tok = NULL;
+ }
+ if (!tok) {
+ TSError("conf_remap: file %s, line %d: the configuration must provide a value", fn, line_num);
+ continue;
+ }
+
+ // Now store the new config
+ switch (type) {
+ case TS_RECORDDATATYPE_INT:
+ _items[_current]._data.rec_int = strtoll(tok, NULL, 10);
+ break;
+ case TS_RECORDDATATYPE_STRING:
+ _items[_current]._data.rec_string = TSstrdup(tok);
+ break;
+ default:
+ TSError("conf_remap: file %s, line %d: type not support (unheard of)", fn, line_num);
+ continue;
+ break;
+ }
+ _items[_current]._name = name;
+ _items[_current]._type = type;
+ ++_current;
+ }
+
+ TSfclose(file);
+ return (_current > 0);
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Initialize the plugin as a remap plugin.
+//
+int
+tsremap_init(TSRemapInterface* api_info, char *errbuf, int errbuf_size)
+{
+ if (!api_info) {
+ strncpy(errbuf, "[tsremap_init] - Invalid TSRemapInterface argument", errbuf_size - 1);
+ return -1;
+ }
+
+ if (api_info->size < sizeof(TSRemapInterface)) {
+ strncpy(errbuf, "[tsremap_init] - Incorrect size of TSRemapInterface structure", errbuf_size - 1);
+ return -2;
+ }
+
+ if (api_info->tsremap_version < TSREMAP_VERSION) {
+ snprintf(errbuf, errbuf_size - 1, "[tsremap_init] - Incorrect API version %ld.%ld",
+ api_info->tsremap_version >> 16, (api_info->tsremap_version & 0xffff));
+ return -3;
+ }
+
+ TSDebug(PLUGIN_NAME, "remap plugin is succesfully initialized");
+ return 0; /* success */
+}
+
+
+int
+tsremap_new_instance(int argc, char* argv[], ihandle* ih, char* errbuf, int errbuf_size)
+{
+ if (argc < 3) {
+ TSError("Unable to create remap instance, need configuration file");
+ return -1;
+ } else {
+ RemapConfigs* conf = new(RemapConfigs);
+
+ if (conf->parse_file(argv[2])) {
+ *ih = static_cast<ihandle>(conf);
+ } else {
+ *ih = NULL;
+ delete conf;
+ }
+ }
+
+ return 0;
+}
+
+void
+tsremap_delete_instance(ihandle ih)
+{
+ RemapConfigs* conf = static_cast<RemapConfigs*>(ih);
+
+ for (int ix=0; ix < conf->_current; ++ix) {
+ if (TS_RECORDDATATYPE_STRING == conf->_items[ix]._type)
+ TSfree(conf->_items[ix]._data.rec_string);
+ }
+
+ delete conf;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Main entry point when used as a remap plugin.
+//
+int
+tsremap_remap(ihandle ih, rhandle rh, TSRemapRequestInfo *rri)
+{
+ if (NULL != ih) {
+ RemapConfigs* conf = static_cast<RemapConfigs*>(ih);
+ TSHttpTxn txnp = static_cast<TSHttpTxn>(rh);
+
+ for (int ix=0; ix < conf->_current; ++ix) {
+ switch (conf->_items[ix]._type) {
+ case TS_RECORDDATATYPE_INT:
+ TSHttpTxnConfigIntSet(txnp, conf->_items[ix]._name, conf->_items[ix]._data.rec_int);
+ TSDebug(PLUGIN_NAME, "Setting config id %d to %d", conf->_items[ix]._name, conf->_items[ix]._data.rec_int);
+ break;
+ case TS_RECORDDATATYPE_STRING:
+ TSHttpTxnConfigStringSet(txnp, conf->_items[ix]._name, conf->_items[ix]._data.rec_string);
+ TSDebug(PLUGIN_NAME, "Setting config id %d to %s", conf->_items[ix]._name, conf->_items[ix]._data.rec_string);
+ break;
+ default:
+ break; // Error ?
+ }
+ }
+ }
+
+ return 0; // This plugin never rewrites anything.
+}
+
+
+
+/*
+ local variables:
+ mode: C++
+ indent-tabs-mode: nil
+ c-basic-offset: 2
+ c-comment-only-line-offset: 0
+ c-file-offsets: ((statement-block-intro . +)
+ (label . 0)
+ (statement-cont . +)
+ (innamespace . 0))
+ end:
+
+ Indent with: /usr/bin/indent -ncs -nut -npcs -l 120 logstats.cc
+*/
Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Sat Jan 1 17:09:03 2011
@@ -7374,4 +7374,150 @@ TSReturnCode TSSkipRemappingSet(TSHttpTx
return TS_SUCCESS;
}
+
+/* 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;
+
+ HttpSM *sm = (HttpSM*) txnp;
+
+ switch (conf) {
+ case TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR:
+ sm->t_state.txn_conf.maintain_pristine_host_hdr = value;
+ break;
+ case TS_CONFIG_HTTP_CHUNKING_ENABLED:
+ sm->t_state.txn_conf.chunking_enabled = value;
+ break;
+ case TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED:
+ sm->t_state.txn_conf.negative_caching_enabled = value;
+ break;
+ case TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE:
+ sm->t_state.txn_conf.cache_when_to_revalidate = value;
+ break;
+ default:
+ return TS_ERROR;
+ break;
+ }
+ return TS_SUCCESS;
+}
+
+TSReturnCode
+TSHttpTxnConfigIntGet(TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt *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_URL_REMAP_PRISTINE_HOST_HDR:
+ *value = sm->t_state.txn_conf.maintain_pristine_host_hdr;
+ 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;
+ default:
+ return TS_ERROR;
+ break;
+ }
+
+ return TS_SUCCESS;
+}
+
+TSReturnCode
+TSHttpTxnConfigStringSet(TSHttpTxn txnp, TSOverridableConfigKey conf, char* 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;
+
+ return TS_SUCCESS;
+}
+
+
+TSReturnCode
+TSHttpTxnConfigStringGet(TSHttpTxn txnp, TSOverridableConfigKey conf, char **value)
+{
+ if ((sdk_sanity_check_txn(txnp) != TS_SUCCESS) ||
+ (sdk_sanity_check_null_ptr((void**)value) != TS_SUCCESS) ||
+ (sdk_sanity_check_null_ptr((void*)*value) != TS_SUCCESS))
+ return TS_ERROR;
+
+ //HttpSM *sm = (HttpSM*) txnp;
+
+ return TS_SUCCESS;
+}
+
+
+// This is pretty suboptimal, and should only be used outside the critical path.
+TSReturnCode
+TSHttpTxnConfigFind(const char* name, int length, TSOverridableConfigKey *conf, TSRecordDataType *type)
+{
+ if ((sdk_sanity_check_null_ptr((void*)name) != TS_SUCCESS) ||
+ (sdk_sanity_check_null_ptr((void*)conf) != TS_SUCCESS))
+ return TS_ERROR;
+
+ if (length == -1)
+ length = strlen(name);
+
+ // Lots of string comparisons here, but avoid a few at least
+ switch (length) {
+ case 34:
+ if (!strncmp(name, "proxy.config.http.chunking_enabled", length)) {
+ *conf = TS_CONFIG_HTTP_CHUNKING_ENABLED;
+ if (type)
+ *type = TS_RECORDDATATYPE_INT;
+ }
+ break;
+
+ case 40:
+ if (!strncmp(name, "proxy.config.url_remap.pristine_host_hdr", length)) {
+ *conf = TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR;
+ if (type)
+ *type = TS_RECORDDATATYPE_INT;
+ }
+ break;
+
+ case 42:
+ switch (name[length-1]) {
+ case 'd':
+ if (!strncmp(name, "proxy.config.http.negative_caching_enabled", length)) {
+ *conf = TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED;
+ if (type)
+ *type = TS_RECORDDATATYPE_INT;
+ }
+ break;
+ case 'e':
+ if (!strncmp(name, "proxy.config.http.cache.when_to_revalidate", length)) {
+ *conf = TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE;
+ if (type)
+ *type = TS_RECORDDATATYPE_INT;
+ }
+ break;
+ default:
+ return TS_ERROR;
+ }
+ break;
+
+ default:
+ return TS_ERROR;
+ }
+
+ return TS_SUCCESS;
+}
+
+
#endif //TS_NO_API
Modified: trafficserver/traffic/trunk/proxy/ReverseProxy.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/ReverseProxy.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/ReverseProxy.cc (original)
+++ trafficserver/traffic/trunk/proxy/ReverseProxy.cc Sat Jan 1 17:09:03 2011
@@ -60,7 +60,6 @@ UrlRewrite *rewrite_table = NULL;
#define AC_PORT_CHANGED 3
#define TRANS_CHANGED 4
#define DEFAULT_TO_PAC_CHANGED 5
-#define PRISTINE_HOST_HDR_CHANGED 6
#define DEFAULT_TO_PAC_PORT_CHANGED 7
#define URL_REMAP_MODE_CHANGED 8
#define HTTP_DEFAULT_REDIRECT_CHANGED 9
@@ -84,7 +83,6 @@ init_reverse_proxy()
REVERSE_RegisterConfigUpdateFunc("proxy.config.admin.autoconf_port", url_rewrite_CB, (void *) AC_PORT_CHANGED);
REVERSE_RegisterConfigUpdateFunc("proxy.config.url_remap.default_to_server_pac", url_rewrite_CB, (void *) DEFAULT_TO_PAC_CHANGED);
REVERSE_RegisterConfigUpdateFunc("proxy.config.url_remap.default_to_server_pac_port", url_rewrite_CB, (void *) DEFAULT_TO_PAC_PORT_CHANGED);
- REVERSE_RegisterConfigUpdateFunc("proxy.config.url_remap.pristine_host_hdr", url_rewrite_CB, (void *) PRISTINE_HOST_HDR_CHANGED);
REVERSE_RegisterConfigUpdateFunc("proxy.config.url_remap.url_remap_mode", url_rewrite_CB, (void *) URL_REMAP_MODE_CHANGED);
REVERSE_RegisterConfigUpdateFunc("proxy.config.http.referer_default_redirect", url_rewrite_CB, (void *) HTTP_DEFAULT_REDIRECT_CHANGED);
return 0;
@@ -183,9 +181,6 @@ url_rewrite_CB(const char *name, RecData
case REVERSE_CHANGED:
rewrite_table->SetReverseFlag(data.rec_int);
break;
- case PRISTINE_HOST_HDR_CHANGED:
- rewrite_table->SetPristineFlag(data.rec_int);
- break;
case TSNAME_CHANGED:
case DEFAULT_TO_PAC_CHANGED:
case DEFAULT_TO_PAC_PORT_CHANGED:
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=1054255&r1=1054254&r2=1054255&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:03 2011
@@ -451,7 +451,7 @@ extern "C"
/**
This type represents a context for data records.
*/
- typedef enum
+ typedef enum
{
TS_RECORDTYPE_NULL = 0,
TS_RECORDTYPE_CONFIG,
@@ -473,7 +473,7 @@ extern "C"
TS_RECORDDATATYPE_MAX
} TSRecordDataType;
- typedef union
+ typedef union
{
int64_t rec_int;
float rec_float;
@@ -481,6 +481,16 @@ extern "C"
int64_t rec_counter;
} TSRecordData;
+ typedef enum
+ {
+ TS_CONFIG_NULL = 0,
+ TS_CONFIG_URL_REMAP_PRISTINE_HOST_HDR,
+ TS_CONFIG_HTTP_CHUNKING_ENABLED,
+ TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED,
+ TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE,
+ TS_CONFIG_LAST_ENTRY
+ } TSOverridableConfigKey;
+
extern tsapi const void *TS_ERROR_PTR;
typedef int64_t TSHRTime;
@@ -2803,6 +2813,18 @@ extern "C"
*/
tsapi TSReturnCode TSSkipRemappingSet(TSHttpTxn txnp, int flag);
+
+ /*
+ Set or get various overridable configurations, for a transaction. This should
+ 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 TSHttpTxnConfigStringSet(TSHttpTxn txnp, TSOverridableConfigKey conf, char* value);
+ tsapi TSReturnCode TSHttpTxnConfigStringGet(TSHttpTxn txnp, TSOverridableConfigKey conf, char **value);
+
+ 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/HttpConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc Sat Jan 1 17:09:03 2011
@@ -31,9 +31,6 @@
#include "ICPProcessor.h"
#include "P_Net.h"
#include "P_RecUtils.h"
-#include <iostream>
-
-using namespace std;
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
@@ -68,39 +65,25 @@ class HttpConfigCont:public Continuation
{
public:
HttpConfigCont();
-
int handle_event(int event, void *edata);
};
-/*
- * char* add_comma_sep_string(char *s, char* a)
- *
- * A helper to fix a configuration conflict. Adds string 'a' to
- * string 's', in a comma seperated manner, if 'a' is not already
- * in 's'.
- */
-
////////////////////////////////////////////////////////////////
//
// static variables
//
////////////////////////////////////////////////////////////////
-int
- HttpConfig::m_id = 0;
-HttpConfigParams
- HttpConfig::m_master;
-HttpUserAgent_RegxEntry *
- HttpConfig::user_agent_list = NULL;
-
-static volatile int
- http_config_changes = 1;
-static HttpConfigCont *
- http_config_cont = NULL;
+int HttpConfig::m_id = 0;
+HttpConfigParams HttpConfig::m_master;
+HttpUserAgent_RegxEntry *HttpConfig::user_agent_list = NULL;
+
+static volatile int http_config_changes = 1;
+static HttpConfigCont *http_config_cont = NULL;
HttpConfigCont::HttpConfigCont()
-:Continuation(new_ProxyMutex())
+ : Continuation(new_ProxyMutex())
{
SET_HANDLER(&HttpConfigCont::handle_event);
}
@@ -1173,7 +1156,7 @@ HttpConfig::startup()
"proxy.config.http.uncacheable_requests_bypass_parent");
HttpEstablishStaticConfigLongLong(c.no_origin_server_dns, "proxy.config.http.no_origin_server_dns");
HttpEstablishStaticConfigLongLong(c.use_client_target_addr, "proxy.config.http.use_client_target_addr");
- HttpEstablishStaticConfigLongLong(c.maintain_pristine_host_hdr, "proxy.config.url_remap.pristine_host_hdr");
+ HttpEstablishStaticConfigLongLong(c.oride.maintain_pristine_host_hdr, "proxy.config.url_remap.pristine_host_hdr");
HttpEstablishStaticConfigLongLong(c.snarf_username_from_authorization,
"proxy.config.http.snarf_username_from_authorization");
@@ -1196,7 +1179,7 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.proxy_server_port, "proxy.config.http.server_port");
HttpEstablishStaticConfigStringAlloc(c.proxy_server_other_ports, "proxy.config.http.server_other_ports");
HttpEstablishStaticConfigLongLong(c.keep_alive_enabled, "proxy.config.http.keep_alive_enabled");
- HttpEstablishStaticConfigLongLong(c.chunking_enabled, "proxy.config.http.chunking_enabled");
+ HttpEstablishStaticConfigLongLong(c.oride.chunking_enabled, "proxy.config.http.chunking_enabled");
HttpEstablishStaticConfigLongLong(c.session_auth_cache_keep_alive_enabled,
"proxy.config.http.session_auth_cache_keep_alive_enabled");
HttpEstablishStaticConfigLongLong(c.origin_server_pipeline, "proxy.config.http.origin_server_pipeline");
@@ -1324,7 +1307,7 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.ignore_accept_charset_mismatch,
"proxy.config.http.cache.ignore_accept_charset_mismatch");
- HttpEstablishStaticConfigLongLong(c.cache_when_to_revalidate, "proxy.config.http.cache.when_to_revalidate");
+ HttpEstablishStaticConfigLongLong(c.oride.cache_when_to_revalidate, "proxy.config.http.cache.when_to_revalidate");
HttpEstablishStaticConfigLongLong(c.cache_when_to_add_no_cache_to_msie_requests,
"proxy.config.http.cache.when_to_add_no_cache_to_msie_requests");
HttpEstablishStaticConfigLongLong(c.cache_required_headers, "proxy.config.http.cache.required_headers");
@@ -1379,8 +1362,7 @@ HttpConfig::startup()
"proxy.config.http.negative_revalidating_lifetime");
// Negative response caching
- // Note: negative caching behavior can be changed via remap option @no_negative_cache
- HttpEstablishStaticConfigLongLong(c.negative_caching_enabled, "proxy.config.http.negative_caching_enabled");
+ HttpEstablishStaticConfigLongLong(c.oride.negative_caching_enabled, "proxy.config.http.negative_caching_enabled");
HttpEstablishStaticConfigLongLong(c.negative_caching_lifetime, "proxy.config.http.negative_caching_lifetime");
// InktoSwitch
@@ -1490,7 +1472,7 @@ HttpConfig::reconfigure()
params->uncacheable_requests_bypass_parent = INT_TO_BOOL(m_master.uncacheable_requests_bypass_parent);
params->no_origin_server_dns = INT_TO_BOOL(m_master.no_origin_server_dns);
params->use_client_target_addr = INT_TO_BOOL(m_master.use_client_target_addr);
- params->maintain_pristine_host_hdr = INT_TO_BOOL(m_master.maintain_pristine_host_hdr);
+ params->oride.maintain_pristine_host_hdr = INT_TO_BOOL(m_master.oride.maintain_pristine_host_hdr);
params->snarf_username_from_authorization = INT_TO_BOOL(m_master.snarf_username_from_authorization);
@@ -1531,7 +1513,7 @@ HttpConfig::reconfigure()
params->proxy_server_port = m_master.proxy_server_port;
params->proxy_server_other_ports = xstrdup(m_master.proxy_server_other_ports);
params->keep_alive_enabled = INT_TO_BOOL(m_master.keep_alive_enabled);
- params->chunking_enabled = INT_TO_BOOL(m_master.chunking_enabled);
+ 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;
params->user_agent_pipeline = m_master.user_agent_pipeline;
@@ -1633,7 +1615,7 @@ HttpConfig::reconfigure()
params->ignore_accept_encoding_mismatch = INT_TO_BOOL(m_master.ignore_accept_encoding_mismatch);
params->ignore_accept_charset_mismatch = INT_TO_BOOL(m_master.ignore_accept_charset_mismatch);
- params->cache_when_to_revalidate = m_master.cache_when_to_revalidate;
+ params->oride.cache_when_to_revalidate = m_master.oride.cache_when_to_revalidate;
params->cache_when_to_add_no_cache_to_msie_requests = m_master.cache_when_to_add_no_cache_to_msie_requests;
params->cache_required_headers = m_master.cache_required_headers;
@@ -1676,7 +1658,7 @@ HttpConfig::reconfigure()
params->negative_revalidating_enabled = m_master.negative_revalidating_enabled;
params->negative_revalidating_lifetime = m_master.negative_revalidating_lifetime;
- params->negative_caching_enabled = m_master.negative_caching_enabled;
+ params->oride.negative_caching_enabled = m_master.oride.negative_caching_enabled;
params->negative_caching_lifetime = m_master.negative_caching_lifetime;
params->inktoswitch_enabled = m_master.inktoswitch_enabled;
Modified: trafficserver/traffic/trunk/proxy/http2/HttpConfig.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpConfig.h?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpConfig.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpConfig.h Sat Jan 1 17:09:03 2011
@@ -402,6 +402,23 @@ struct HttpConfigPortRange
};
/////////////////////////////////////////////////////////////
+// This is a little helper class, used by the HttpConfigParams
+// and State (txn) structure. It allows for certain configs
+// to be overridable per transaction more easily.
+struct OverridableHttpConfigParams {
+ OverridableHttpConfigParams()
+ : maintain_pristine_host_hdr(0), chunking_enabled(0), negative_caching_enabled(0),
+ cache_when_to_revalidate(0)
+ {}
+
+ MgmtInt maintain_pristine_host_hdr;
+ MgmtInt chunking_enabled;
+ MgmtInt negative_caching_enabled;
+ MgmtInt cache_when_to_revalidate;
+};
+
+
+/////////////////////////////////////////////////////////////
//
// struct HttpConfigParams
//
@@ -451,7 +468,6 @@ public:
MgmtInt uncacheable_requests_bypass_parent;
MgmtInt no_origin_server_dns;
MgmtInt use_client_target_addr;
- MgmtInt maintain_pristine_host_hdr;
MgmtInt snarf_username_from_authorization;
@@ -483,7 +499,6 @@ public:
MgmtInt proxy_server_port;
char *proxy_server_other_ports;
MgmtInt keep_alive_enabled;
- MgmtInt chunking_enabled;
MgmtInt session_auth_cache_keep_alive_enabled;
MgmtInt origin_server_pipeline;
MgmtInt user_agent_pipeline;
@@ -602,7 +617,6 @@ public:
MgmtInt cache_ignore_auth;
MgmtInt cache_urls_that_look_dynamic;
MgmtInt cache_enable_default_vary_headers;
- MgmtInt cache_when_to_revalidate;
MgmtInt cache_when_to_add_no_cache_to_msie_requests;
MgmtInt cache_required_headers;
MgmtInt cache_range_lookup;
@@ -673,7 +687,6 @@ public:
////////////////////////////////
// Negative Response Caching //
////////////////////////////////
- MgmtInt negative_caching_enabled;
MgmtInt negative_caching_lifetime;
/////////////////
@@ -770,6 +783,8 @@ public:
////////////////////////////////
MgmtInt normalize_ae_gzip;
+ OverridableHttpConfigParams oride;
+
private:
/////////////////////////////////////
// operator = and copy constructor //
@@ -859,162 +874,156 @@ extern volatile int32_t icp_dynamic_enab
/////////////////////////////////////////////////////////////
inline
HttpConfigParams::HttpConfigParams()
- :
-proxy_hostname(0),
-proxy_hostname_len(0),
-incoming_ip_to_bind(0),
-incoming_ip_to_bind_saddr(0),
-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),
-enable_url_expandomatic(0),
-no_dns_forward_to_parent(0),
-uncacheable_requests_bypass_parent(1),
-no_origin_server_dns(0),
-use_client_target_addr(0),
-maintain_pristine_host_hdr(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),
-proxy_response_via_string(0),
-proxy_response_via_string_len(0),
-wuts_enabled(false),
-log_spider_codes(false),
-url_expansions_string(0),
-url_expansions(0),
-num_url_expansions(0),
-proxy_server_port(0),
-proxy_server_other_ports(0),
-keep_alive_enabled(0),
-chunking_enabled(0),
-session_auth_cache_keep_alive_enabled(0),
-origin_server_pipeline(0),
-user_agent_pipeline(0),
-share_server_sessions(0),
-keep_alive_post_out(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),
-transaction_active_timeout_in(0),
-transaction_active_timeout_out(0),
-accept_no_activity_timeout(0),
-background_fill_active_timeout(0),
-background_fill_threshold(0.0),
-connect_attempts_max_retries(0),
-connect_attempts_max_retries_dead_server(0),
-connect_attempts_rr_retries(0),
-connect_attempts_timeout(0),
-post_connect_attempts_timeout(0),
-parent_connect_attempts(0),
-per_parent_connect_attempts(0),
-parent_connect_timeout(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),
-anonymize_remove_cookie(false),
-anonymize_remove_client_ip(false),
-anonymize_insert_client_ip(true),
-append_xforwards_header(false),
-anonymize_other_header_list(NULL),
-anonymize_remove_any(false),
-global_user_agent_header(NULL),
-global_user_agent_header_size(0),
-proxy_response_server_string(NULL),
-proxy_response_server_string_len(0),
-proxy_response_server_enabled(0),
-insert_squid_x_forwarded_for(0),
-insert_age_in_response(1),
-avoid_content_spoofing(1),
-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),
-freshness_fuzz_prob(0.0),
-cache_vary_default_text(0),
-cache_vary_default_images(0),
-cache_vary_default_other(0),
-max_cache_open_read_retries(0),
-cache_open_read_retry_time(0),
-max_cache_open_write_retries(0),
-cache_open_write_retry_time(0),
-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_responses_to_cookies(0),
-cache_ignore_auth(0),
-cache_urls_that_look_dynamic(false),
-cache_enable_default_vary_headers(false),
-cache_when_to_revalidate(0),
-cache_when_to_add_no_cache_to_msie_requests(0),
-cache_required_headers(CACHE_REQUIRED_HEADERS_NONE),
-connect_ports_string(0),
-connect_ports(0),
-request_hdr_max_size(0),
-response_hdr_max_size(0),
-push_method_enabled(0),
-referer_filter_enabled(0),
-referer_format_redirect(0),
-accept_encoding_filter_enabled(0),
-quick_filter_mask(0),
-transparency_enabled(0),
-down_server_timeout(0),
-client_abort_threshold(0),
-negative_revalidating_enabled(0),
-negative_revalidating_lifetime(0),
-negative_caching_enabled(0),
-negative_caching_lifetime(0),
-inktoswitch_enabled(0),
-router_ip(0),
-router_port(0),
-record_cop_page(0),
-record_tcp_mem_hit(0),
-errors_log_error_pages(0),
-send_http11_requests(SEND_HTTP11_IF_REQUEST_11_AND_HOSTDB),
-doc_in_cache_skip_dns(1), // Added for SKIPPING DNS If DOC IN CACHE
-default_buffer_size_index(0),
-default_buffer_water_mark(0),
-enable_http_info(0),
-fwd_proxy_auth_to_parent(0),
-cluster_time_delta(0),
- //Added by YTS Team, yamsat
-hashtable_enabled(false),
-rww_wait_time(0),
-revalidate_window_period(0),
-srv_enabled(0),
-redirection_enabled(true),
-number_of_redirections(0),
-post_copy_size(2048),
-ignore_accept_mismatch(0),
-ignore_accept_language_mismatch(0),
-ignore_accept_encoding_mismatch(0),
-ignore_accept_charset_mismatch(0),
-normalize_ae_gzip(1)
+ : proxy_hostname(0),
+ proxy_hostname_len(0),
+ incoming_ip_to_bind(0),
+ incoming_ip_to_bind_saddr(0),
+ 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),
+ enable_url_expandomatic(0),
+ no_dns_forward_to_parent(0),
+ uncacheable_requests_bypass_parent(1),
+ 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),
+ proxy_response_via_string(0),
+ proxy_response_via_string_len(0),
+ wuts_enabled(false),
+ log_spider_codes(false),
+ url_expansions_string(0),
+ url_expansions(0),
+ num_url_expansions(0),
+ proxy_server_port(0),
+ proxy_server_other_ports(0),
+ keep_alive_enabled(0),
+ session_auth_cache_keep_alive_enabled(0),
+ origin_server_pipeline(0),
+ user_agent_pipeline(0),
+ share_server_sessions(0),
+ keep_alive_post_out(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),
+ transaction_active_timeout_in(0),
+ transaction_active_timeout_out(0),
+ accept_no_activity_timeout(0),
+ background_fill_active_timeout(0),
+ background_fill_threshold(0.0),
+ connect_attempts_max_retries(0),
+ connect_attempts_max_retries_dead_server(0),
+ connect_attempts_rr_retries(0),
+ connect_attempts_timeout(0),
+ post_connect_attempts_timeout(0),
+ parent_connect_attempts(0),
+ per_parent_connect_attempts(0),
+ parent_connect_timeout(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),
+ anonymize_remove_cookie(false),
+ anonymize_remove_client_ip(false),
+ anonymize_insert_client_ip(true),
+ append_xforwards_header(false),
+ anonymize_other_header_list(NULL),
+ anonymize_remove_any(false),
+ global_user_agent_header(NULL),
+ global_user_agent_header_size(0),
+ proxy_response_server_string(NULL),
+ proxy_response_server_string_len(0),
+ proxy_response_server_enabled(0),
+ insert_squid_x_forwarded_for(0),
+ insert_age_in_response(1),
+ avoid_content_spoofing(1),
+ 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),
+ freshness_fuzz_prob(0.0),
+ cache_vary_default_text(0),
+ cache_vary_default_images(0),
+ cache_vary_default_other(0),
+ max_cache_open_read_retries(0),
+ cache_open_read_retry_time(0),
+ max_cache_open_write_retries(0),
+ cache_open_write_retry_time(0),
+ 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_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),
+ connect_ports_string(0),
+ connect_ports(0),
+ request_hdr_max_size(0),
+ response_hdr_max_size(0),
+ push_method_enabled(0),
+ referer_filter_enabled(0),
+ referer_format_redirect(0),
+ accept_encoding_filter_enabled(0),
+ quick_filter_mask(0),
+ transparency_enabled(0),
+ down_server_timeout(0),
+ 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),
+ record_cop_page(0),
+ record_tcp_mem_hit(0),
+ errors_log_error_pages(0),
+ send_http11_requests(SEND_HTTP11_IF_REQUEST_11_AND_HOSTDB),
+ doc_in_cache_skip_dns(1), // Added for SKIPPING DNS If DOC IN CACHE
+ default_buffer_size_index(0),
+ default_buffer_water_mark(0),
+ enable_http_info(0),
+ fwd_proxy_auth_to_parent(0),
+ cluster_time_delta(0),
+ //Added by YTS Team, yamsat
+ hashtable_enabled(false),
+ rww_wait_time(0),
+ revalidate_window_period(0),
+ srv_enabled(0),
+ redirection_enabled(true),
+ number_of_redirections(0),
+ post_copy_size(2048),
+ ignore_accept_mismatch(0),
+ ignore_accept_language_mismatch(0),
+ ignore_accept_encoding_mismatch(0),
+ ignore_accept_charset_mismatch(0),
+ normalize_ae_gzip(1)
{
}
inline
-HttpConfigParams::~
-HttpConfigParams()
+HttpConfigParams::~HttpConfigParams()
{
xfree(proxy_hostname);
xfree(proxy_request_via_string);
Modified: trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSM.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSM.cc Sat Jan 1 17:09:03 2011
@@ -407,6 +407,8 @@ HttpSM::init()
t_state.state_machine = this;
t_state.http_config_param = HttpConfig::acquire();
+ // TODO: this might want to be "lazy" (on write from a plugin)
+ memcpy(&(t_state.txn_conf), &(t_state.http_config_param->oride), sizeof(t_state.txn_conf));
// update the cache info config structure so that
// selection from alternates happens correctly.
@@ -4016,9 +4018,7 @@ HttpSM::do_cache_delete_all_alts(Continu
INK_MD5 md5b;
t_state.hdr_info.client_request.url_get()->MD5_get(&md5a);
t_state.cache_info.lookup_url->MD5_get(&md5b);
- ink_assert(md5a == md5b ||
- t_state.http_config_param->maintain_pristine_host_hdr ||
- t_state.pristine_host_hdr > 0);
+ ink_assert(md5a == md5b || t_state.txn_conf.maintain_pristine_host_hdr);
#endif
Debug("http_seq", "[HttpSM::do_cache_update] Issuing cache delete for %s",
Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Sat Jan 1 17:09:03 2011
@@ -253,7 +253,7 @@ find_appropriate_cached_resp(HttpTransac
inline static bool
is_negative_caching_appropriate(HttpTransact::State * s)
{
- if (!s->http_config_param->negative_caching_enabled || s->no_negative_cache || !s->hdr_info.server_response.valid())
+ if (!s->txn_conf.negative_caching_enabled || !s->hdr_info.server_response.valid())
return false;
switch (s->hdr_info.server_response.status_get()) {
@@ -1818,7 +1818,7 @@ HttpTransact::DecideCacheLookup(State *
if (s->cache_info.lookup_url == NULL) {
HTTPHdr* incoming_request = &(s->hdr_info.client_request);
- if (s->pristine_host_hdr > 0 || s->http_config_param->maintain_pristine_host_hdr) {
+ if (s->txn_conf.maintain_pristine_host_hdr) {
s->cache_info.lookup_url_storage.create(NULL);
s->cache_info.lookup_url_storage.copy(incoming_request->url_get());
s->cache_info.lookup_url = &(s->cache_info.lookup_url_storage);
@@ -1836,7 +1836,7 @@ HttpTransact::DecideCacheLookup(State *
// the stupid content on the Host header!!!!
// We could a) have 6000 alts (barf, puke, vomit) or b) use the original
// host header in the url before doing all cache actions (lookups, writes, etc.)
- if (s->http_config_param->maintain_pristine_host_hdr || s->pristine_host_hdr > 0) {
+ if (s->txn_conf.maintain_pristine_host_hdr) {
// So, the host header will have the original host header.
int host_len;
const char *host_hdr = incoming_request->value_get(MIME_FIELD_HOST, MIME_LEN_HOST, &host_len);
@@ -2214,7 +2214,7 @@ HttpTransact::issue_revalidate(State * s
case HTTP_STATUS_OK: // 200
// don't conditionalize if we are configured to repeat the clients
// conditionals
- if (s->http_config_param->cache_when_to_revalidate == 4)
+ if (s->txn_conf.cache_when_to_revalidate == 4)
break;
// ok, request is either a conditional or does not have a no-cache.
// (or is method that we don't conditionalize but lookup the
@@ -2298,8 +2298,7 @@ HttpTransact::HandleCacheOpenReadHitFres
if (s->cache_lookup_result == HttpTransact::CACHE_LOOKUP_NONE) {
// is the document still fresh enough to be served back to
// the client without revalidation?
- Freshness_t freshness = what_is_document_freshness(s, s->http_config_param, &s->hdr_info.client_request,
- obj->request_get(), obj->response_get());
+ Freshness_t freshness = what_is_document_freshness(s, &s->hdr_info.client_request, obj->request_get(), obj->response_get());
switch (freshness) {
case FRESHNESS_FRESH:
Debug("http_seq", "[HttpTransact::HandleCacheOpenReadHitFreshness] " "Fresh copy");
@@ -4172,7 +4171,7 @@ HttpTransact::handle_cache_operation_on_
// CACHE_DO_UPDATE and server response is cacheable
if (is_request_conditional(&s->hdr_info.client_request)) {
- if (s->http_config_param->cache_when_to_revalidate != 4)
+ if (s->txn_conf.cache_when_to_revalidate != 4)
client_response_code =
HttpTransactCache::match_response_to_request_conditionals(&s->hdr_info.client_request,
s->cache_info.object_read->response_get());
@@ -4184,7 +4183,7 @@ HttpTransact::handle_cache_operation_on_
if (client_response_code != HTTP_STATUS_OK) {
// delete the cached copy unless configured to always verify IMS
- if (s->http_config_param->cache_when_to_revalidate != 4) {
+ if (s->txn_conf.cache_when_to_revalidate != 4) {
s->cache_info.action = CACHE_DO_UPDATE;
s->next_action = PROXY_INTERNAL_CACHE_UPDATE_HEADERS;
/* base_response will be set after updating headers below */
@@ -6347,7 +6346,7 @@ HttpTransact::is_response_cacheable(Stat
return (false);
}
// default cacheability
- if (!s->http_config_param->negative_caching_enabled || s->no_negative_cache) {
+ if (!s->txn_conf.negative_caching_enabled) {
if ((response_code == HTTP_STATUS_OK) ||
(response_code == HTTP_STATUS_NOT_MODIFIED) ||
(response_code == HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION) ||
@@ -7083,10 +7082,8 @@ HttpTransact::handle_response_keep_alive
// to the client to keep the connection alive.
// Insert a Transfer-Encoding header in the response if necessary.
- if (// check that the client is HTTP 1.1 and the conf allows chunking
- s->client_info.http_version == HTTPVersion(1, 1) &&
- ((s->http_config_param->chunking_enabled == 1 && s->remap_chunking_enabled != 0) ||
- (s->http_config_param->chunking_enabled == 0 && s->remap_chunking_enabled == 1)) &&
+ // check that the client is HTTP 1.1 and the conf allows chunking
+ if (s->client_info.http_version == HTTPVersion(1, 1) && s->txn_conf.chunking_enabled == 1 &&
// if we're not sending a body, don't set a chunked header regardless of server response
!is_response_body_precluded(s->hdr_info.client_response.status_get(), s->method) &&
// we do not need chunked encoding for internal error messages
@@ -7423,8 +7420,8 @@ HttpTransact::calculate_freshness_fuzz(S
//
//////////////////////////////////////////////////////////////////////////////
HttpTransact::Freshness_t
-HttpTransact::what_is_document_freshness(State *s, const HttpConfigParams *config, HTTPHdr* client_request,
- HTTPHdr* cached_obj_request, HTTPHdr * cached_obj_response)
+HttpTransact::what_is_document_freshness(State *s, HTTPHdr* client_request, HTTPHdr* cached_obj_request,
+ HTTPHdr * cached_obj_response)
{
NOWARN_UNUSED(cached_obj_request);
bool heuristic, do_revalidate = false;
@@ -7476,11 +7473,11 @@ HttpTransact::what_is_document_freshness
response_date,
&heuristic,
s->request_sent_time,
- config->cache_heuristic_min_lifetime,
- config->cache_heuristic_max_lifetime,
- config->cache_heuristic_lm_factor,
- config->cache_guaranteed_min_lifetime,
- config->cache_guaranteed_max_lifetime, s->plugin_set_expire_time, s);
+ s->http_config_param->cache_heuristic_min_lifetime,
+ s->http_config_param->cache_heuristic_max_lifetime,
+ s->http_config_param->cache_heuristic_lm_factor,
+ s->http_config_param->cache_guaranteed_min_lifetime,
+ s->http_config_param->cache_guaranteed_max_lifetime, s->plugin_set_expire_time, s);
HTTP_DEBUG_ASSERT(fresh_limit >= 0);
// Fuzz the freshness to prevent too many revalidates to popular
@@ -7491,8 +7488,7 @@ HttpTransact::what_is_document_freshness
fresh_limit = min(NUM_SECONDS_IN_ONE_YEAR, fresh_limit);
}
- current_age = HttpTransactHeaders::calculate_document_age(s->request_sent_time,
- s->response_received_time,
+ current_age = HttpTransactHeaders::calculate_document_age(s->request_sent_time, s->response_received_time,
cached_obj_response, response_date, s->current.now);
// Overflow ?
@@ -7508,11 +7504,11 @@ HttpTransact::what_is_document_freshness
/////////////////////////////////////////////////////////
HTTP_DEBUG_ASSERT(client_request == &s->hdr_info.client_request);
- if (config->cache_when_to_revalidate == 0) {
+ if (s->txn_conf.cache_when_to_revalidate == 0) {
;
// Compute how fresh below
} else if (client_request->url_get()->scheme_get_wksidx() == URL_WKSIDX_HTTP) {
- switch (config->cache_when_to_revalidate) {
+ switch (s->txn_conf.cache_when_to_revalidate) {
case 1: // Stale if heuristic
if (heuristic) {
Debug("http_match", "[what_is_document_freshness] config requires FRESHNESS_STALE because heuristic calculation");
@@ -7922,7 +7918,7 @@ HttpTransact::build_request(State * s, H
// from the O.S., we will save bandwidth between proxy and O.S.
if (s->current.mode == GENERIC_PROXY) {
if (is_request_likely_cacheable(s, base_request)) {
- if (s->http_config_param->cache_when_to_revalidate != 4) {
+ if (s->txn_conf.cache_when_to_revalidate != 4) {
Debug("http_trans", "[build_request] " "request like cacheable and conditional headers removed");
HttpTransactHeaders::remove_conditional_headers(base_request, outgoing_request);
} else
Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.h?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.h Sat Jan 1 17:09:03 2011
@@ -991,9 +991,6 @@ public:
// for negative caching
bool negative_caching;
- bool no_negative_cache; // copy from per-remap rules
- int pristine_host_hdr;
- int remap_chunking_enabled;
// for authenticated content caching
CacheAuth_t www_auth_content;
@@ -1059,6 +1056,8 @@ public:
bool api_skip_all_remapping;
+ OverridableHttpConfigParams txn_conf;
+
// Methods
void
init()
@@ -1109,9 +1108,6 @@ public:
current_stats(NULL),
range_setup(RANGE_NONE),
negative_caching(false),
- no_negative_cache(false),
- pristine_host_hdr(-1),
- remap_chunking_enabled(-1),
www_auth_content(CACHE_AUTH_NONE),
client_connection_enabled(true),
acl_filtering_performed(false),
@@ -1373,8 +1369,8 @@ public:
int cache_guaranteed_min_lifetime, int cache_guaranteed_max_lifetime,
time_t plugin_set_expire_time, State * s);
static int calculate_freshness_fuzz(State * s, int fresh_limit);
- static Freshness_t what_is_document_freshness(State * s, const HttpConfigParams * config, HTTPHdr * client_request,
- HTTPHdr * cached_obj_request, HTTPHdr * cached_obj_response);
+ static Freshness_t what_is_document_freshness(State * s, HTTPHdr * client_request, HTTPHdr * cached_obj_request,
+ HTTPHdr * cached_obj_response);
static Authentication_t AuthenticationNeeded(const HttpConfigParams * p, HTTPHdr * client_request, HTTPHdr * obj_response);
static void handle_parent_died(State * s);
static void handle_server_died(State * s);
Modified: trafficserver/traffic/trunk/proxy/http2/remap/RemapPluginInfo.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/RemapPluginInfo.h?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/RemapPluginInfo.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/RemapPluginInfo.h Sat Jan 1 17:09:03 2011
@@ -33,11 +33,6 @@
#define REMAP_OPTFLG_METHOD 0x08 /* "method=" option (used for ACL filtering) */
#define REMAP_OPTFLG_SRC_IP 0x10 /* "src_ip=" option (used for ACL filtering) */
#define REMAP_OPTFLG_ACTION 0x20 /* "action=" option (used for ACL filtering) */
-#define REMAP_OPTFLG_NONEGCACHE 0x40 /* "no_negative_cache" option */
-#define REMAP_OPTFLG_PRISTINEHOST_HDR_ENABLED 0x80 /* if pristinem header is enabled */
-#define REMAP_OPTFLG_PRISTINEHOST_HDR_DISABLED 0x100 /*if pristine header is disabled */
-#define REMAP_OPTFLG_CHUNKING_ENABLED 0x200 /* enable chunking for this map rule */
-#define REMAP_OPTFLG_CHUNKING_DISABLED 0x400 /* disable chunking for this map rule */
#define REMAP_OPTFLG_MAP_ID 0x800 /* associate a map ID with this rule */
#define REMAP_OPTFLG_INVERT 0x80000000 /* "invert" the rule (for src_ip at least) */
#define REMAP_OPTFLG_ALL_FILTERS (REMAP_OPTFLG_METHOD|REMAP_OPTFLG_SRC_IP|REMAP_OPTFLG_ACTION)
Modified: trafficserver/traffic/trunk/proxy/http2/remap/RemapPlugins.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/RemapPlugins.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/RemapPlugins.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/RemapPlugins.cc Sat Jan 1 17:09:03 2011
@@ -240,13 +240,6 @@ RemapPlugins::run_single_remap()
bool debug_on = false;
int retcode = 0; // 0 - no redirect, !=0 - redirected
- // it is important - we must copy "no_negative_cache" flag before possible plugin call [only do this on our first iteration of this function]
- if (_cur == 0 && _s) {
- _s->no_negative_cache = map->no_negative_cache;
- _s->pristine_host_hdr = map->pristine_host_hdr;
- _s->remap_chunking_enabled = map->chunking_enabled;
- }
-
requestPath = _request_url->path_get(&requestPathLen);
toHost = map_to->host_get(&toHostLen);
Modified: trafficserver/traffic/trunk/proxy/http2/remap/RemapProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/RemapProcessor.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/RemapProcessor.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/RemapProcessor.cc Sat Jan 1 17:09:03 2011
@@ -224,9 +224,8 @@ RemapProcessor::finish_remap(HttpTransac
// pristine host hdr is not enabled
int host_len;
const char *host_hdr = request_header->value_get(MIME_FIELD_HOST, MIME_LEN_HOST, &host_len);
- if (request_url && host_hdr != NULL &&
- ((rewrite_table->pristine_host_hdr <= 0 && s->pristine_host_hdr <= 0) ||
- (rewrite_table->pristine_host_hdr > 0 && s->pristine_host_hdr == 0))) {
+
+ if (request_url && host_hdr != NULL && s->txn_conf.maintain_pristine_host_hdr == 0) {
remapped_host = request_url->host_get(&remapped_host_len);
remapped_port = request_url->port_get_raw();
Modified: trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.cc Sat Jan 1 17:09:03 2011
@@ -28,8 +28,8 @@
**/
url_mapping::url_mapping(int rank /* = 0 */)
: from_path_len(0), fromURL(), homePageRedirect(false), unique(false), default_redirect_url(false),
- optional_referer(false), negative_referer(false), no_negative_cache(false), wildcard_from_scheme(false),
- pristine_host_hdr(-1), chunking_enabled(-1), tag(NULL), filter_redirect_url(NULL), referer_list(0),
+ optional_referer(false), negative_referer(false), wildcard_from_scheme(false),
+ tag(NULL), filter_redirect_url(NULL), referer_list(0),
redir_chunk_list(0), filter(NULL), _plugin_count(0), _cur_instance_count(0), _rank(rank), _default_to_url()
{
}
Modified: trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.h?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/UrlMapping.h Sat Jan 1 17:09:03 2011
@@ -103,10 +103,7 @@ public:
bool default_redirect_url;
bool optional_referer;
bool negative_referer;
- bool no_negative_cache; // @no_negative_cache option was used
bool wildcard_from_scheme; // from url is '/foo', only http or https for now
- int pristine_host_hdr;
- int chunking_enabled;
char *tag; // tag
char *filter_redirect_url; // redirect url
unsigned int map_id;
Modified: trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.cc?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.cc Sat Jan 1 17:09:03 2011
@@ -87,26 +87,6 @@ check_remap_option(char *argv[], int arg
if (argptr)
*argptr = &argv[i][7];
ret_flags |= REMAP_OPTFLG_ACTION;
- } else if (!ink_string_fast_strcasecmp(argv[i], "no_negative_cache")) {
- if ((findmode & REMAP_OPTFLG_NONEGCACHE) != 0)
- idx = i;
- ret_flags |= REMAP_OPTFLG_NONEGCACHE;
- } else if (!ink_string_fast_strcasecmp(argv[i], "pristine_host_hdr=1")) {
- if ((findmode & REMAP_OPTFLG_PRISTINEHOST_HDR_ENABLED) != 0)
- idx = i;
- ret_flags |= REMAP_OPTFLG_PRISTINEHOST_HDR_ENABLED;
- } else if (!ink_string_fast_strcasecmp(argv[i], "pristine_host_hdr=0")) {
- if ((findmode & REMAP_OPTFLG_PRISTINEHOST_HDR_DISABLED) != 0)
- idx = i;
- ret_flags |= REMAP_OPTFLG_PRISTINEHOST_HDR_DISABLED;
- } else if (!ink_string_fast_strcasecmp(argv[i], "chunking_enabled=1")) {
- if ((findmode & REMAP_OPTFLG_CHUNKING_ENABLED) != 0)
- idx = i;
- ret_flags |= REMAP_OPTFLG_CHUNKING_ENABLED;
- } else if (!ink_string_fast_strcasecmp(argv[i], "chunking_enabled=0")) {
- if ((findmode & REMAP_OPTFLG_CHUNKING_DISABLED) != 0)
- idx = i;
- ret_flags |= REMAP_OPTFLG_CHUNKING_DISABLED;
} else if (!ink_string_fast_strncasecmp(argv[i], "mapid=", 6)) {
if ((findmode & REMAP_OPTFLG_MAP_ID) != 0)
idx = i;
@@ -497,7 +477,7 @@ process_filter_opt(url_mapping * mp, BUI
// CTOR / DTOR for the UrlRewrite class.
//
UrlRewrite::UrlRewrite(const char *file_var_in)
- : nohost_rules(0), reverse_proxy(0), pristine_host_hdr(0), backdoor_enabled(0),
+ : nohost_rules(0), reverse_proxy(0), backdoor_enabled(0),
mgmt_autoconf_port(0), default_to_pac(0), default_to_pac_port(0), file_var(NULL), ts_name(NULL),
http_default_redirect_url(NULL), num_rules_forward(0), num_rules_reverse(0), num_rules_redirect_permanent(0),
num_rules_redirect_temporary(0), remap_pi_list(NULL)
@@ -540,7 +520,6 @@ UrlRewrite::UrlRewrite(const char *file_
REVERSE_ReadConfigInteger(mgmt_autoconf_port, "proxy.config.admin.autoconf_port");
REVERSE_ReadConfigInteger(default_to_pac, "proxy.config.url_remap.default_to_server_pac");
REVERSE_ReadConfigInteger(default_to_pac_port, "proxy.config.url_remap.default_to_server_pac_port");
- REVERSE_ReadConfigInteger(pristine_host_hdr, "proxy.config.url_remap.pristine_host_hdr");
REVERSE_ReadConfigInteger(url_remap_mode, "proxy.config.url_remap.url_remap_mode");
REVERSE_ReadConfigInteger(backdoor_enabled, "proxy.config.url_remap.handle_backdoor_urls");
@@ -587,15 +566,6 @@ UrlRewrite::SetReverseFlag(int flag)
Print();
}
-/** Sets the reverse proxy flag. */
-void
-UrlRewrite::SetPristineFlag(int flag)
-{
- pristine_host_hdr = flag;
- if (is_debug_tag_set("url_rewrite"))
- Print();
-}
-
/**
Allocaites via new, and setups the default mapping to the PAC generator
port which is used to serve the PAC (proxy autoconfig) file.
@@ -1024,17 +994,6 @@ UrlRewrite::BuildTable()
if ((errStr = process_filter_opt(new_mapping, &bti, errStrBuf, sizeof(errStrBuf))) != NULL) {
goto MAP_ERROR;
}
- // apply "no_negative_cache" if we have to
- if ((bti.remap_optflg & REMAP_OPTFLG_NONEGCACHE) != 0)
- new_mapping->no_negative_cache = true;
- if ((bti.remap_optflg & REMAP_OPTFLG_PRISTINEHOST_HDR_ENABLED) != 0)
- new_mapping->pristine_host_hdr = 1;
- if ((bti.remap_optflg & REMAP_OPTFLG_PRISTINEHOST_HDR_DISABLED) != 0)
- new_mapping->pristine_host_hdr = 0;
- if ((bti.remap_optflg & REMAP_OPTFLG_CHUNKING_ENABLED) != 0)
- new_mapping->chunking_enabled = 1;
- if ((bti.remap_optflg & REMAP_OPTFLG_CHUNKING_DISABLED) != 0)
- new_mapping->chunking_enabled = 0;
new_mapping->map_id = 0;
if ((bti.remap_optflg & REMAP_OPTFLG_MAP_ID) != 0) {
Modified: trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.h?rev=1054255&r1=1054254&r2=1054255&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/remap/UrlRewrite.h Sat Jan 1 17:09:03 2011
@@ -74,7 +74,6 @@ public:
~UrlRewrite();
int BuildTable();
void SetReverseFlag(int flag);
- void SetPristineFlag(int flag);
void Print();
// private:
@@ -159,7 +158,6 @@ public:
int nohost_rules;
int reverse_proxy;
- int pristine_host_hdr;
int backdoor_enabled;
// Vars for PAC mapping