You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2016/10/17 16:59:38 UTC
[trafficserver] branch 7.0.x updated (d413eb5 -> b61327d)
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a change to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.
from d413eb5 TS-4949: Disables the fuzzy revalidation logic by default
new 495db5a TS-4942: simple retry is not working correctly.
new c47d7c6 TS-4959: Remove remnants of an old browser
new 097d150 TS-4959: Remove remnants of an configuration / UA
new b61327d TS-4072 Diagnostic log rolling races. This closes #568.
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
doc/admin-guide/files/records.config.en.rst | 7 -
doc/admin-guide/plugins/ts_lua.en.rst | 1 -
.../api/functions/TSHttpOverridableConfig.en.rst | 1 -
.../api/types/TSOverridableConfigKey.en.rst | 2 -
.../api/functions/TSHttpOverridableConfig.en.po | 4 -
lib/ts/BaseLogFile.cc | 5 +-
lib/ts/Diags.cc | 140 +++++++------
lib/ts/apidefs.h.in | 2 -
plugins/experimental/ts_lua/ts_lua_http_config.c | 2 -
proxy/InkAPI.cc | 8 -
proxy/InkAPITest.cc | 1 -
proxy/http/HttpConfig.cc | 3 -
proxy/http/HttpConfig.h | 40 ----
proxy/http/HttpTransact.cc | 218 +++++----------------
14 files changed, 135 insertions(+), 299 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].
[trafficserver] 02/04: TS-4959: Remove remnants of an old browser
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit c47d7c62544d4f42754937770424d936e986386c
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Wed Oct 12 13:51:08 2016 -0600
TS-4959: Remove remnants of an old browser
(cherry picked from commit f412172e322c94b593841ed80f6609d96aba631c)
---
proxy/http/HttpTransact.cc | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index fce713b..44ee24a 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -8222,34 +8222,7 @@ HttpTransact::build_error_response(State *s, HTTPStatus status_code, const char
}
}
}
- if (status_code == HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED && s->method == HTTP_WKSIDX_CONNECT &&
- s->hdr_info.client_response.presence(MIME_PRESENCE_PROXY_CONNECTION)) {
- int has_ua_msie = 0;
- int user_agent_value_len, slen;
- const char *user_agent_value, *c, *e;
-
- user_agent_value = s->hdr_info.client_request.value_get(MIME_FIELD_USER_AGENT, MIME_LEN_USER_AGENT, &user_agent_value_len);
- if (user_agent_value && user_agent_value_len >= 4) {
- c = user_agent_value;
- e = c + user_agent_value_len - 4;
- while (1) {
- slen = (int)(e - c);
- c = (const char *)memchr(c, 'M', slen);
- if (c == NULL || (e - c) < 3) {
- break;
- }
- if ((c[1] == 'S') && (c[2] == 'I') && (c[3] == 'E')) {
- has_ua_msie = 1;
- break;
- }
- c++;
- }
- }
- if (has_ua_msie) {
- s->hdr_info.client_response.value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "close", 5);
- }
- }
// Add a bunch of headers to make sure that caches between
// the Traffic Server and the client do not cache the error
// page.
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 01/04: TS-4942: simple retry is not working
correctly.
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 495db5a1aa4dce768f8d534654af5f0faefa34fc
Author: John J. Rushford <jr...@apache.org>
AuthorDate: Fri Oct 7 17:29:20 2016 +0000
TS-4942: simple retry is not working correctly.
(cherry picked from commit 1fdc8ab1f229e8c6d00b34bcd64fff23c9c01ddf)
---
proxy/http/HttpTransact.cc | 94 +++++++++++++++++++++++-----------------------
1 file changed, 48 insertions(+), 46 deletions(-)
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 2e42d42..fce713b 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3605,28 +3605,8 @@ HttpTransact::handle_response_from_parent(State *s)
break;
default: {
LookingUp_t next_lookup = UNDEFINED_LOOKUP;
- DebugTxn("http_trans", "[hrfp] connection not alive");
- SET_VIA_STRING(VIA_DETAIL_PP_CONNECT, VIA_DETAIL_PP_FAILURE);
- ink_assert(s->hdr_info.server_request.valid());
-
- s->current.server->connect_result = ENOTCONN;
- s->state_machine->do_hostdb_update_if_necessary();
-
- char addrbuf[INET6_ADDRSTRLEN];
- DebugTxn("http_trans", "[%d] failed to connect to parent %s", s->current.attempts,
- ats_ip_ntop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)));
-
- // If the request is not retryable, just give up!
- if (!is_request_retryable(s)) {
- s->parent_params->markParentDown(&s->parent_result);
- s->parent_result.result = PARENT_FAIL;
- handle_parent_died(s);
- return;
- }
-
- // try a simple retry if we received a simple retryable response from the parent.
- if (s->current.retry_type == PARENT_RETRY_SIMPLE || s->current.retry_type == PARENT_RETRY_UNAVAILABLE_SERVER) {
+ if (s->current.state == PARENT_ORIGIN_RETRY) {
if (s->current.retry_type == PARENT_RETRY_SIMPLE) {
if (s->current.simple_retry_attempts >= s->parent_result.max_retries(PARENT_RETRY_SIMPLE)) {
DebugTxn("http_trans", "PARENT_RETRY_SIMPLE: retried all parents, send error to client.");
@@ -3637,7 +3617,7 @@ HttpTransact::handle_response_from_parent(State *s)
s->current.retry_type = PARENT_RETRY_NONE;
next_lookup = find_server_and_update_current_info(s);
}
- } else { // try unavailable server retry if we have a unavailable server retry response from the parent.
+ } else if (s->current.retry_type == PARENT_RETRY_UNAVAILABLE_SERVER) {
if (s->current.unavailable_server_retry_attempts >= s->parent_result.max_retries(PARENT_RETRY_UNAVAILABLE_SERVER)) {
DebugTxn("http_trans", "PARENT_RETRY_UNAVAILABLE_SERVER: retried all parents, send error to client.");
s->current.retry_type = PARENT_RETRY_NONE;
@@ -3649,37 +3629,59 @@ HttpTransact::handle_response_from_parent(State *s)
next_lookup = find_server_and_update_current_info(s);
}
}
- } else if (s->current.attempts < s->txn_conf->parent_connect_attempts) {
- s->current.attempts++;
+ } else {
+ DebugTxn("http_trans", "[hrfp] connection not alive");
+ SET_VIA_STRING(VIA_DETAIL_PP_CONNECT, VIA_DETAIL_PP_FAILURE);
- // Are we done with this particular parent?
- if ((s->current.attempts - 1) % s->http_config_param->per_parent_connect_attempts != 0) {
- // No we are not done with this parent so retry
- s->next_action = how_to_open_connection(s);
- DebugTxn("http_trans", "%s Retrying parent for attempt %d, max %" PRId64, "[handle_response_from_parent]",
- s->current.attempts, s->http_config_param->per_parent_connect_attempts);
+ ink_assert(s->hdr_info.server_request.valid());
+
+ s->current.server->connect_result = ENOTCONN;
+ s->state_machine->do_hostdb_update_if_necessary();
+
+ char addrbuf[INET6_ADDRSTRLEN];
+ DebugTxn("http_trans", "[%d] failed to connect to parent %s", s->current.attempts,
+ ats_ip_ntop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)));
+
+ // If the request is not retryable, just give up!
+ if (!is_request_retryable(s)) {
+ s->parent_params->markParentDown(&s->parent_result);
+ s->parent_result.result = PARENT_FAIL;
+ handle_parent_died(s);
return;
- } else {
- DebugTxn("http_trans", "%s %d per parent attempts exhausted", "[handle_response_from_parent]", s->current.attempts);
+ }
+
+ if (s->current.attempts < s->txn_conf->parent_connect_attempts) {
+ s->current.attempts++;
- // Only mark the parent down if we failed to connect
- // to the parent otherwise slow origin servers cause
- // us to mark the parent down
+ // Are we done with this particular parent?
+ if ((s->current.attempts - 1) % s->http_config_param->per_parent_connect_attempts != 0) {
+ // No we are not done with this parent so retry
+ s->next_action = how_to_open_connection(s);
+ DebugTxn("http_trans", "%s Retrying parent for attempt %d, max %" PRId64, "[handle_response_from_parent]",
+ s->current.attempts, s->http_config_param->per_parent_connect_attempts);
+ return;
+ } else {
+ DebugTxn("http_trans", "%s %d per parent attempts exhausted", "[handle_response_from_parent]", s->current.attempts);
+
+ // Only mark the parent down if we failed to connect
+ // to the parent otherwise slow origin servers cause
+ // us to mark the parent down
+ if (s->current.state == CONNECTION_ERROR) {
+ s->parent_params->markParentDown(&s->parent_result);
+ }
+ // We are done so look for another parent if any
+ next_lookup = find_server_and_update_current_info(s);
+ }
+ } else {
+ // Done trying parents... fail over to origin server if that is
+ // appropriate
+ DebugTxn("http_trans", "[handle_response_from_parent] Error. No more retries.");
if (s->current.state == CONNECTION_ERROR) {
s->parent_params->markParentDown(&s->parent_result);
}
- // We are done so look for another parent if any
- next_lookup = find_server_and_update_current_info(s);
- }
- } else {
- // Done trying parents... fail over to origin server if that is
- // appropriate
- DebugTxn("http_trans", "[handle_response_from_parent] Error. No more retries.");
- if (s->current.state == CONNECTION_ERROR) {
- s->parent_params->markParentDown(&s->parent_result);
+ s->parent_result.result = PARENT_FAIL;
+ next_lookup = find_server_and_update_current_info(s);
}
- s->parent_result.result = PARENT_FAIL;
- next_lookup = find_server_and_update_current_info(s);
}
// We have either tried to find a new parent or failed over to the
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 04/04: TS-4072 Diagnostic log rolling races. This
closes #568.
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit b61327deaa36c459644ab6490fbe28419a142738
Author: Daniel Xu <dl...@yahoo.com>
AuthorDate: Sun May 15 23:18:43 2016 -0500
TS-4072 Diagnostic log rolling races.
This closes #568.
Use preexisting mutex to prevent race condition when rotating
diags_log, stdout_log, and stderr_log.
(cherry picked from commit 346b4192e4004c0cbfb93b34965a0394212c35b4)
---
lib/ts/BaseLogFile.cc | 5 +-
lib/ts/Diags.cc | 140 ++++++++++++++++++++++++++++++--------------------
2 files changed, 86 insertions(+), 59 deletions(-)
diff --git a/lib/ts/BaseLogFile.cc b/lib/ts/BaseLogFile.cc
index c18232b..5993d06 100644
--- a/lib/ts/BaseLogFile.cc
+++ b/lib/ts/BaseLogFile.cc
@@ -151,9 +151,6 @@ BaseLogFile::roll(long interval_start, long interval_end)
char end_time_ext[64];
time_t start, end;
- // Make sure the file is closed so we don't leak any descriptors.
- close_file();
-
// Start with conservative values for the start and end bounds, then
// try to refine.
start = 0L;
@@ -165,7 +162,7 @@ BaseLogFile::roll(long interval_start, long interval_end)
// our starting bounds. Instead, we'll try to use the file
// creation time stored in the metafile (if it's valid and we can
// read it). If all else fails, we'll use 0 for the start time.
- log_log_trace("in BaseLogFile::roll(..) used metadata starttime");
+ log_log_trace("in BaseLogFile::roll(..) used metadata starttime\n");
m_meta_info->get_creation_time(&start);
} else {
// The logfile was not preexisting (normal case), so we'll use
diff --git a/lib/ts/Diags.cc b/lib/ts/Diags.cc
index 45ed9b2..825ad1d 100644
--- a/lib/ts/Diags.cc
+++ b/lib/ts/Diags.cc
@@ -612,11 +612,11 @@ Diags::should_roll_diagslog()
{
bool ret_val = false;
- log_log_trace("should_roll_diagslog() was called\n");
- log_log_trace("rolling_enabled = %d, output_rolling_size = %d, output_rolling_interval = %d\n", diagslog_rolling_enabled,
- diagslog_rolling_size, diagslog_rolling_interval);
- log_log_trace("RollingEnabledValues::ROLL_ON_TIME = %d\n", RollingEnabledValues::ROLL_ON_TIME);
- log_log_trace("time(0) - last_roll_time = %d\n", time(0) - diagslog_time_last_roll);
+ log_log_trace("%s was called\n", __func__);
+ log_log_trace("%s: rolling_enabled = %d, output_rolling_size = %d, output_rolling_interval = %d\n", __func__,
+ diagslog_rolling_enabled, diagslog_rolling_size, diagslog_rolling_interval);
+ log_log_trace("%s: RollingEnabledValues::ROLL_ON_TIME = %d\n", __func__, RollingEnabledValues::ROLL_ON_TIME);
+ log_log_trace("%s: time(0) - last_roll_time = %d\n", __func__, time(0) - diagslog_time_last_roll);
// Roll diags_log if necessary
if (diags_log && diags_log->is_init()) {
@@ -631,11 +631,14 @@ Diags::should_roll_diagslog()
fflush(diags_log->m_fp);
if (diags_log->roll()) {
char *oldname = ats_strdup(diags_log->get_name());
- log_log_trace("in should_roll_logs() for diags.log, oldname=%s\n", oldname);
+ log_log_trace("in %s for diags.log, oldname=%s\n", __func__, oldname);
BaseLogFile *n = new BaseLogFile(oldname);
if (setup_diagslog(n)) {
- delete diags_log;
+ BaseLogFile *old_diags = diags_log;
+ lock();
diags_log = n;
+ unlock();
+ delete old_diags;
}
ats_free(oldname);
ret_val = true;
@@ -648,11 +651,14 @@ Diags::should_roll_diagslog()
if (diags_log->roll()) {
diagslog_time_last_roll = now;
char *oldname = ats_strdup(diags_log->get_name());
- log_log_trace("in should_roll_logs() for diags.log, oldname=%s\n", oldname);
+ log_log_trace("in %s for diags.log, oldname=%s\n", __func__, oldname);
BaseLogFile *n = new BaseLogFile(oldname);
if (setup_diagslog(n)) {
- delete diags_log;
+ BaseLogFile *old_diags = diags_log;
+ lock();
diags_log = n;
+ unlock();
+ delete old_diags;
}
ats_free(oldname);
ret_val = true;
@@ -687,14 +693,12 @@ Diags::should_roll_outputlog()
bool ret_val = false;
bool need_consider_stderr = true;
- /*
- log_log_trace("should_roll_outputlog() was called\n");
- log_log_trace("rolling_enabled = %d, output_rolling_size = %d, output_rolling_interval = %d\n", outputlog_rolling_enabled,
- outputlog_rolling_size, outputlog_rolling_interval);
- log_log_trace("RollingEnabledValues::ROLL_ON_TIME = %d\n", RollingEnabledValues::ROLL_ON_TIME);
- log_log_trace("time(0) - last_roll_time = %d\n", time(0) - outputlog_time_last_roll);
- log_log_trace("stdout_log = %p\n", stdout_log);
- */
+ log_log_trace("%s was called\n", __func__);
+ log_log_trace("%s: rolling_enabled = %d, output_rolling_size = %d, output_rolling_interval = %d\n", __func__,
+ outputlog_rolling_enabled, outputlog_rolling_size, outputlog_rolling_interval);
+ log_log_trace("%s: RollingEnabledValues::ROLL_ON_TIME = %d\n", __func__, RollingEnabledValues::ROLL_ON_TIME);
+ log_log_trace("%s: time(0) - last_roll_time = %d\n", __func__, time(0) - outputlog_time_last_roll);
+ log_log_trace("%s: stdout_log = %p\n", __func__, stdout_log);
// Roll stdout_log if necessary
if (stdout_log->is_init()) {
@@ -714,7 +718,7 @@ Diags::should_roll_outputlog()
if (stdout_log->roll()) {
char *oldname = ats_strdup(stdout_log->get_name());
- log_log_trace("in should_roll_logs(), oldname=%s\n", oldname);
+ log_log_trace("in %s(), oldname=%s\n", __func__, oldname);
set_stdout_output(oldname);
// if stderr and stdout are redirected to the same place, we should
@@ -740,7 +744,7 @@ Diags::should_roll_outputlog()
if (stdout_log->roll()) {
outputlog_time_last_roll = now;
char *oldname = ats_strdup(stdout_log->get_name());
- log_log_trace("in should_roll_logs(), oldname=%s\n", oldname);
+ log_log_trace("in %s, oldname=%s\n", __func__, oldname);
set_stdout_output(oldname);
// if stderr and stdout are redirected to the same place, we should
@@ -773,7 +777,7 @@ Diags::should_roll_outputlog()
}
/*
- * Binds stdout to _bind_stdout, provided that _bind_stdout != "".
+ * Binds stdout to stdout_path, provided that stdout_path != "".
* Also sets up a BaseLogFile for stdout.
*
* Returns true on binding and setup, false otherwise
@@ -782,71 +786,97 @@ Diags::should_roll_outputlog()
* set_stderr_output
*/
bool
-Diags::set_stdout_output(const char *_bind_stdout)
+Diags::set_stdout_output(const char *stdout_path)
{
- if (strcmp(_bind_stdout, "") == 0)
+ if (strcmp(stdout_path, "") == 0)
return false;
- if (stdout_log) {
- delete stdout_log;
- stdout_log = NULL;
- }
-
- // create backing BaseLogFile for stdout
- stdout_log = new BaseLogFile(_bind_stdout);
+ BaseLogFile *old_stdout_log = stdout_log;
+ BaseLogFile *new_stdout_log = new BaseLogFile(stdout_path);
// on any errors we quit
- if (!stdout_log || stdout_log->open_file() != BaseLogFile::LOG_FILE_NO_ERROR) {
- fprintf(stderr, "[Warning]: unable to open file=%s to bind stdout to\n", _bind_stdout);
- delete stdout_log;
+ if (!new_stdout_log || new_stdout_log->open_file() != BaseLogFile::LOG_FILE_NO_ERROR) {
+ log_log_error("[Warning]: unable to open file=%s to bind stdout to\n", stdout_path);
+ log_log_error("[Warning]: stdout is currently not bound to anything\n");
+ delete new_stdout_log;
+ lock();
stdout_log = NULL;
+ unlock();
return false;
}
- if (!stdout_log->m_fp) {
- fprintf(stderr, "[Warning]: file pointer for stdout %s = NULL\n", _bind_stdout);
- delete stdout_log;
+ if (!new_stdout_log->is_open()) {
+ log_log_error("[Warning]: file pointer for stdout %s = NULL\n", stdout_path);
+ log_log_error("[Warning]: stdout is currently not bound to anything\n");
+ delete new_stdout_log;
+ lock();
stdout_log = NULL;
+ unlock();
return false;
}
- return rebind_stdout(fileno(stdout_log->m_fp));
+ // now exchange the stdout_log pointer
+ lock();
+ stdout_log = new_stdout_log;
+ bool ret = rebind_stdout(fileno(new_stdout_log->m_fp));
+ unlock();
+
+ if (old_stdout_log)
+ delete old_stdout_log;
+
+ // "this should never happen"^{TM}
+ ink_release_assert(ret);
+
+ return ret;
}
/*
- * Binds stderr to _bind_stderr, provided that _bind_stderr != "".
+ * Binds stderr to stderr_path, provided that stderr_path != "".
* Also sets up a BaseLogFile for stderr.
*
* Returns true on binding and setup, false otherwise
*/
bool
-Diags::set_stderr_output(const char *_bind_stderr)
+Diags::set_stderr_output(const char *stderr_path)
{
- if (strcmp(_bind_stderr, "") == 0)
+ if (strcmp(stderr_path, "") == 0)
return false;
- if (stderr_log) {
- delete stderr_log;
- stderr_log = NULL;
- }
-
- // create backing BaseLogFile for stdout
- stderr_log = new BaseLogFile(_bind_stderr);
+ BaseLogFile *old_stderr_log = stderr_log;
+ BaseLogFile *new_stderr_log = new BaseLogFile(stderr_path);
// on any errors we quit
- if (!stderr_log || stderr_log->open_file() != BaseLogFile::LOG_FILE_NO_ERROR) {
- fprintf(stderr, "[Warning]: unable to open file=%s to bind stderr to\n", _bind_stderr);
- delete stderr_log;
+ if (!new_stderr_log || new_stderr_log->open_file() != BaseLogFile::LOG_FILE_NO_ERROR) {
+ log_log_error("[Warning]: unable to open file=%s to bind stderr to\n", stderr_path);
+ log_log_error("[Warning]: stderr is currently not bound to anything\n");
+ delete new_stderr_log;
+ lock();
stderr_log = NULL;
+ unlock();
return false;
}
- if (!stderr_log->m_fp) {
- fprintf(stderr, "[Warning]: file pointer for stderr %s = NULL\n", _bind_stderr);
- delete stderr_log;
+ if (!new_stderr_log->is_open()) {
+ log_log_error("[Warning]: file pointer for stderr %s = NULL\n", stderr_path);
+ log_log_error("[Warning]: stderr is currently not bound to anything\n");
+ delete new_stderr_log;
+ lock();
stderr_log = NULL;
+ unlock();
return false;
}
- return rebind_stderr(fileno(stderr_log->m_fp));
+ // now exchange the stderr_log pointer
+ lock();
+ stderr_log = new_stderr_log;
+ bool ret = rebind_stderr(fileno(stderr_log->m_fp));
+ unlock();
+
+ if (old_stderr_log)
+ delete old_stderr_log;
+
+ // "this should never happen"^{TM}
+ ink_release_assert(ret);
+
+ return ret;
}
/*
@@ -858,7 +888,7 @@ bool
Diags::rebind_stdout(int new_fd)
{
if (new_fd < 0)
- fprintf(stdout, "[Warning]: TS unable to bind stdout to new file descriptor=%d", new_fd);
+ log_log_error("[Warning]: TS unable to bind stdout to new file descriptor=%d", new_fd);
else {
dup2(new_fd, STDOUT_FILENO);
return true;
@@ -875,7 +905,7 @@ bool
Diags::rebind_stderr(int new_fd)
{
if (new_fd < 0)
- fprintf(stdout, "[Warning]: TS unable to bind stderr to new file descriptor=%d", new_fd);
+ log_log_error("[Warning]: TS unable to bind stderr to new file descriptor=%d", new_fd);
else {
dup2(new_fd, STDERR_FILENO);
return true;
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 03/04: TS-4959: Remove remnants of an configuration
/ UA
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 7.0.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 097d1503a1925583d7ff93cc639f6d147c3ca18e
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Wed Oct 12 15:18:24 2016 -0600
TS-4959: Remove remnants of an configuration / UA
(cherry picked from commit c71e4ccb1954cabfca078c22b21f38b7cf1cae93)
---
doc/admin-guide/files/records.config.en.rst | 7 --
doc/admin-guide/plugins/ts_lua.en.rst | 1 -
.../api/functions/TSHttpOverridableConfig.en.rst | 1 -
.../api/types/TSOverridableConfigKey.en.rst | 2 -
.../api/functions/TSHttpOverridableConfig.en.po | 4 -
lib/ts/apidefs.h.in | 2 -
plugins/experimental/ts_lua/ts_lua_http_config.c | 2 -
proxy/InkAPI.cc | 8 --
proxy/InkAPITest.cc | 1 -
proxy/http/HttpConfig.cc | 3 -
proxy/http/HttpConfig.h | 40 ---------
proxy/http/HttpTransact.cc | 97 +---------------------
12 files changed, 1 insertion(+), 167 deletions(-)
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index d4e8f23..4ac9e40 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -1130,13 +1130,6 @@ ip-resolve
Controls wether new POST requests re-use keep-alive sessions (``1``) or
create new connections per request (``0``).
-.. ts:cv:: CONFIG proxy.config.http.accept_encoding_filter_enabled INT 0
-
- Enables (``1``) or disables (``0``) additional handling of ``Accept-encoding``
- header on incoming requests based on the ``User-Agent`` header, to account
- for known deficiencies in legacy browsers which mis-report the encodings
- they are able to accept.
-
.. ts:cv:: CONFIG proxy.config.http.disallow_post_100_continue INT 0
Allows you to return a 405 Method Not Supported with Posts also
diff --git a/doc/admin-guide/plugins/ts_lua.en.rst b/doc/admin-guide/plugins/ts_lua.en.rst
index 25bb61d..128ea19 100644
--- a/doc/admin-guide/plugins/ts_lua.en.rst
+++ b/doc/admin-guide/plugins/ts_lua.en.rst
@@ -2882,7 +2882,6 @@ Http config constants
TS_LUA_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE
TS_LUA_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED
TS_LUA_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME
- TS_LUA_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED
TS_LUA_CONFIG_SSL_HSTS_MAX_AGE
TS_LUA_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS
TS_LUA_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME
diff --git a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
index 10f4aa1..2d8095f 100644
--- a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
+++ b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
@@ -140,7 +140,6 @@ The following configurations (from ``records.config``) are overridable.
| :ts:cv:`proxy.config.http.response_header_max_size`
| :ts:cv:`proxy.config.http.negative_revalidating_enabled`
| :ts:cv:`proxy.config.http.negative_revalidating_lifetime`
-| :ts:cv:`proxy.config.http.accept_encoding_filter_enabled`
| :ts:cv:`proxy.config.http.cache.range.write`
| :ts:cv:`proxy.config.http.global_user_agent_header`
| :ts:cv:`proxy.config.http.slow.log.threshold`
diff --git a/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst b/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
index abe1045..e106bc5 100644
--- a/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
+++ b/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
@@ -189,8 +189,6 @@ Enumeration Members
.. c:member:: TSOverridableConfigKey TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME
-.. c:member:: TSOverridableConfigKey TS_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED
-
.. c:member:: TSOverridableConfigKey TS_CONFIG_SSL_HSTS_MAX_AGE
.. c:member:: TSOverridableConfigKey TS_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS
diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po
index 7c961d9..41f9cea 100644
--- a/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po
+++ b/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po
@@ -388,10 +388,6 @@ msgstr ""
msgid ":ts:cv:`proxy.config.http.negative_revalidating_lifetime`"
msgstr ""
-#: ../../../developer-guide/api/functions/TSHttpOverridableConfig.en.rst:143
-msgid ":ts:cv:`proxy.config.http.accept_encoding_filter_enabled`"
-msgstr ""
-
#: ../../../developer-guide/api/functions/TSHttpOverridableConfig.en.rst:144
msgid ":ts:cv:`proxy.config.http.cache.range.write`"
msgstr ""
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index 885a7f8..637e5c5 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -717,7 +717,6 @@ typedef enum {
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_SSL_HSTS_MAX_AGE,
TS_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS,
TS_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME,
@@ -1154,7 +1153,6 @@ extern tsapi const char *const TS_PROTO_TAG_UDP;
extern tsapi const char *const TS_PROTO_TAG_IPV4;
extern tsapi const char *const TS_PROTO_TAG_IPV6;
-
/* --------------------------------------------------------------------------
MLoc Constants */
/**
diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c b/plugins/experimental/ts_lua/ts_lua_http_config.c
index 6252fac..4b65b71 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_config.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_config.c
@@ -95,7 +95,6 @@ typedef enum {
TS_LUA_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE = TS_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE,
TS_LUA_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED = TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED,
TS_LUA_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME = TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME,
- TS_LUA_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED = TS_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED,
TS_LUA_CONFIG_SSL_HSTS_MAX_AGE = TS_CONFIG_SSL_HSTS_MAX_AGE,
TS_LUA_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS = TS_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS,
TS_LUA_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME = TS_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME,
@@ -207,7 +206,6 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_NEGATIVE_REVALIDATING_ENABLED),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_SSL_HSTS_MAX_AGE),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_SSL_HSTS_INCLUDE_SUBDOMAINS),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME),
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index b1c9ba0..9429304 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -7988,9 +7988,6 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
typ = OVERRIDABLE_TYPE_INT;
ret = &overridableHttpConfig->negative_revalidating_lifetime;
break;
- case TS_CONFIG_HTTP_ACCEPT_ENCODING_FILTER_ENABLED:
- ret = &overridableHttpConfig->accept_encoding_filter_enabled;
- break;
case TS_CONFIG_SSL_HSTS_MAX_AGE:
typ = OVERRIDABLE_TYPE_INT;
ret = &overridableHttpConfig->proxy_response_hsts_max_age;
@@ -8703,11 +8700,6 @@ 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;
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index fe91445..1f44748 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7592,7 +7592,6 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
"proxy.config.http.response_header_max_size",
"proxy.config.http.negative_revalidating_enabled",
"proxy.config.http.negative_revalidating_lifetime",
- "proxy.config.http.accept_encoding_filter_enabled",
"proxy.config.ssl.hsts_max_age",
"proxy.config.ssl.hsts_include_subdomains",
"proxy.config.http.cache.open_read_retry_time",
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index c4cab56..58e30a9 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -120,7 +120,6 @@ static const ConfigEnumPair<TSServerSessionSharingPoolType> SessionSharingPoolSt
////////////////////////////////////////////////////////////////
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;
@@ -1347,8 +1346,6 @@ HttpConfig::reconfigure()
params->strict_uri_parsing = INT_TO_BOOL(m_master.strict_uri_parsing);
- 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;
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 0390183..7e4fdd8 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -402,7 +402,6 @@ struct OverridableHttpConfigParams {
insert_response_via_string(0),
doc_in_cache_skip_dns(1),
flow_control_enabled(0),
- accept_encoding_filter_enabled(0),
normalize_ae_gzip(0),
srv_enabled(0),
cache_open_write_fail_action(0),
@@ -543,11 +542,6 @@ 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 //
////////////////////////////////
@@ -821,39 +815,6 @@ private:
/////////////////////////////////////////////////////////////
//
-// class HttpUserAgent_RegxEntry
-//
-// configuration entry for specific User-Agent
-// Created at startup time only and never changed
-// The main purpose of the User-Agent filtering is to find "bad" user agents
-// and modify Accept-Encoding to prevent compression for such "bad" guys
-/////////////////////////////////////////////////////////////
-
-class HttpUserAgent_RegxEntry
-{
-public:
- typedef enum { // for more details, please see comments in "ae_ua.config" file
- STRTYPE_UNKNOWN = 0,
- STRTYPE_SUBSTR_CASE, /* .substring, .string */
- STRTYPE_SUBSTR_NCASE, /* .substring_ncase, .string_ncase */
- STRTYPE_REGEXP /* .regexp POSIX regular expression */
- } StrType;
-
- HttpUserAgent_RegxEntry *next;
- int user_agent_str_size;
- char *user_agent_str;
- bool regx_valid;
- StrType stype;
- pcre *regx;
-
- HttpUserAgent_RegxEntry();
- ~HttpUserAgent_RegxEntry();
-
- bool create(char *refexp_str = NULL, char *errmsgbuf = NULL, int errmsgbuf_size = 0);
-};
-
-/////////////////////////////////////////////////////////////
-//
// class HttpConfig
//
/////////////////////////////////////////////////////////////
@@ -879,7 +840,6 @@ public:
public:
static int m_id;
static HttpConfigParams m_master;
- static HttpUserAgent_RegxEntry *user_agent_list;
};
// DI's request to disable ICP on the fly
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 44ee24a..0147934 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -647,94 +647,6 @@ HttpTransact::HandleBlindTunnel(State *s)
HandleRequest(s);
}
-bool
-HttpTransact::perform_accept_encoding_filtering(State *s)
-{
- HttpUserAgent_RegxEntry *uae;
- HTTPHdr *client_request;
- MIMEField *accept_field;
- MIMEField *usragent_field;
- char tmp_ua_buf[1024], *c;
- char const *u_agent = NULL;
- int u_agent_len = 0;
- bool retcode = false;
- bool ua_match = false;
-
- client_request = &s->hdr_info.client_request;
-
- // Make sense to check Accept-Encoding if UserAgent is present (and matches)
- if ((usragent_field = client_request->field_find(MIME_FIELD_USER_AGENT, MIME_LEN_USER_AGENT)) != 0 &&
- (u_agent = usragent_field->value_get(&u_agent_len)) != 0 && u_agent_len > 0) {
- if (u_agent_len >= (int)sizeof(tmp_ua_buf)) {
- u_agent_len = (int)(sizeof(tmp_ua_buf) - 1);
- }
- memcpy(tmp_ua_buf, u_agent, u_agent_len);
- tmp_ua_buf[u_agent_len] = '\0';
-
- // TODO: Do we really want to do these hardcoded checks still?
- // Check hardcoded case MSIE>6 & Mozilla>4
- if ((c = strstr(tmp_ua_buf, "MSIE")) != NULL) {
- if (c[5] >= '7' && c[5] <= '9') {
- return false; // Don't change anything for IE > 6
- }
- ua_match = true;
- } else if (!strncasecmp(tmp_ua_buf, "mozilla", 7)) {
- if (tmp_ua_buf[8] >= '5' && tmp_ua_buf[8] <= '9') {
- return false; // Don't change anything for Mozilla > 4
- }
- ua_match = true;
- }
-
- // Check custom filters
- if (!ua_match && HttpConfig::user_agent_list) {
- for (uae = HttpConfig::user_agent_list; uae && !ua_match; uae = uae->next) {
- switch (uae->stype) {
- case HttpUserAgent_RegxEntry::STRTYPE_SUBSTR_CASE: /* .substring, .string */
- if (u_agent_len >= uae->user_agent_str_size && !memcmp(tmp_ua_buf, uae->user_agent_str, uae->user_agent_str_size)) {
- ua_match = true;
- }
- break;
- case HttpUserAgent_RegxEntry::STRTYPE_SUBSTR_NCASE: /* .substring_ncase, .string_ncase */
- if (u_agent_len >= uae->user_agent_str_size && !strncasecmp(uae->user_agent_str, tmp_ua_buf, uae->user_agent_str_size)) {
- ua_match = true;
- }
- break;
- case HttpUserAgent_RegxEntry::STRTYPE_REGEXP: /* .regexp POSIX regular expression */
- if (uae->regx_valid && !pcre_exec(uae->regx, NULL, tmp_ua_buf, u_agent_len, 0, 0, NULL, 0)) {
- ua_match = true;
- }
- break;
- default: /* unknown type in the structure - bad initialization - impossible bug! */
- /* I can use ink_error() here since we should shutdown TS immediately */
- ink_error("[HttpTransact::perform_accept_encoding_filtering] - get unknown User-Agent string type - bad initialization");
- };
- }
- }
-
- /* If we have correct User-Agent header ....
- Just set Accept-Encoding: identity or .... do nothing because
- "If no Accept-Encoding field is present in a request, the server MAY assume that the client
- will accept any content coding. In this case, if "identity" is one of the available content-codings,
- then the server SHOULD use the "identity" content-coding, unless it has additional information that
- a different content-coding is meaningful to the client." */
- if (ua_match) {
- DebugTxn("http_trans", "HttpTransact::ModifyRequest, insert identity Accept-Encoding");
- accept_field = client_request->field_find(MIME_FIELD_ACCEPT_ENCODING, MIME_LEN_ACCEPT_ENCODING);
- if (!accept_field) {
- accept_field = client_request->field_create(MIME_FIELD_ACCEPT_ENCODING, MIME_LEN_ACCEPT_ENCODING);
- if (accept_field) {
- client_request->field_attach(accept_field);
- }
- }
- if (accept_field) {
- client_request->field_value_set(accept_field, HTTP_VALUE_IDENTITY, HTTP_LEN_IDENTITY);
- }
- }
- retcode = true;
- } // end of 'user-agent'
- return retcode;
-}
-
void
HttpTransact::StartRemapRequest(State *s)
{
@@ -1212,16 +1124,9 @@ HttpTransact::ModifyRequest(State *s)
}
}
- /////////////////////////////////////////////////////////
- // Modify Accept-Encoding for several specific User-Agent
- /////////////////////////////////////////////////////////
- if (s->txn_conf->accept_encoding_filter_enabled) {
- perform_accept_encoding_filtering(s);
- }
-
DebugTxn("http_trans", "END HttpTransact::ModifyRequest");
-
DebugTxn("http_trans", "Checking if transaction wants to upgrade");
+
if (handle_upgrade_request(s)) {
// everything should be handled by the upgrade handler.
DebugTxn("http_trans", "Transaction will be upgraded by the appropriate upgrade handler.");
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.