[trafficserver] branch master updated: TS-4431: ATSCPPAPI needs a mutex for intercept plugins
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new d363b83 TS-4431: ATSCPPAPI needs a mutex for intercept plugins d363b83 is described below commit d363b83410e2a2790af03201b0cd6ab8a507769c Author: Brian Geffon AuthorDate: Mon May 9 01:56:54 2016 -0700 TS-4431: ATSCPPAPI needs a mutex for intercept plugins --- lib/atscppapi/src/InterceptPlugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/atscppapi/src/InterceptPlugin.cc b/lib/atscppapi/src/InterceptPlugin.cc index d51164a..a55e2ef 100644 --- a/lib/atscppapi/src/InterceptPlugin.cc +++ b/lib/atscppapi/src/InterceptPlugin.cc @@ -121,7 +121,7 @@ void destroyCont(InterceptPlugin::State *state); InterceptPlugin::InterceptPlugin(Transaction &transaction, InterceptPlugin::Type type) : TransactionPlugin(transaction) { - TSCont cont = TSContCreate(handleEvents, NULL); + TSCont cont = TSContCreate(handleEvents, TSMutexCreate()); state_ = new State(cont, this); TSContDataSet(cont, state_); TSHttpTxn txn = static_cast(transaction.getAtsHandle()); -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-4387: When calling TSContSchedule()/TSContScheduleEvery(), the passed in parameter TSCont have to have MUTEX; otherwise if we call TSContSchedule()/TSContSche
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new f96c1f5 TS-4387: When calling TSContSchedule()/TSContScheduleEvery(), the passed in parameter TSCont have to have MUTEX; otherwise if we call TSContSchedule()/TSContScheduleEvery() more than once using same TSCont, only the first call will take effect; all the following schedule are ignored due to MUTEX issue. f96c1f5 is described below commit f96c1f505564280b3f12a98c3ae7abc33b73b168 Author: Shen Zhang AuthorDate: Wed May 4 00:46:21 2016 -0700 TS-4387: When calling TSContSchedule()/TSContScheduleEvery(), the passed in parameter TSCont have to have MUTEX; otherwise if we call TSContSchedule()/TSContScheduleEvery() more than once using same TSCont, only the first call will take effect; all the following schedule are ignored due to MUTEX issue. This closes #603 --- proxy/InkAPI.cc | 4 1 file changed, 4 insertions(+) diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc index 6b2bce2..66f9f50 100644 --- a/proxy/InkAPI.cc +++ b/proxy/InkAPI.cc @@ -4217,6 +4217,8 @@ TSContSchedule(TSCont contp, ink_hrtime timeout, TSThreadPool tp) { sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS); + FORCE_PLUGIN_SCOPED_MUTEX(contp); + INKContInternal *i = (INKContInternal *)contp; TSAction action; @@ -4269,6 +4271,8 @@ TSContScheduleEvery(TSCont contp, ink_hrtime every, TSThreadPool tp) { sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS); + FORCE_PLUGIN_SCOPED_MUTEX(contp); + INKContInternal *i = (INKContInternal *)contp; TSAction action; -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-3922: Websocket Timeouts, transaction overrideable & clang format
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 4fdf8ac TS-3922: Websocket Timeouts, transaction overrideable & clang format 4fdf8ac is described below commit 4fdf8ac21e4dcac97297f6afb03c50a5c997f996 Author: Brian Geffon AuthorDate: Thu Apr 21 04:35:36 2016 -0700 TS-3922: Websocket Timeouts, transaction overrideable & clang format --- plugins/experimental/ts_lua/ts_lua_http_config.c | 198 --- proxy/InkAPITest.cc | 4 +- 2 files changed, 103 insertions(+), 99 deletions(-) diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c b/plugins/experimental/ts_lua/ts_lua_http_config.c index 8b0ddf4..31abb1e 100644 --- a/plugins/experimental/ts_lua/ts_lua_http_config.c +++ b/plugins/experimental/ts_lua/ts_lua_http_config.c @@ -114,6 +114,8 @@ typedef enum { TS_LUA_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY = TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY, TS_LUA_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT = TS_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT, TS_LUA_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE = TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE, + TS_LUA_CONFIG_WEBSOCKET_NO_ACTIVITY_TIMEOUT = TS_CONFIG_WEBSOCKET_NO_ACTIVITY_TIMEOUT, + TS_LUA_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT = TS_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT, TS_LUA_CONFIG_LAST_ENTRY = TS_CONFIG_LAST_ENTRY, } TSLuaOverridableConfigKey; @@ -124,104 +126,104 @@ typedef enum { TS_LUA_TIMEOUT_NO_ACTIVITY = 3 } TSLuaTimeoutKey; -ts_lua_var_item ts_lua_http_config_vars[] = { - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_URL_REMAP_PRISTINE_HOST_HDR), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CHUNKING_ENABLED), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_KEEP_ALIVE_POST_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_NET_SOCK_OPTION_FLAG_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_FORWARD_PROXY_AUTH_TO_PARENT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ANONYMIZE_REMOVE_FROM), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ANONYMIZE_REMOVE_REFERER), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ANONYMIZE_REMOVE_USER_AGENT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ANONYMIZE_REMOVE_COOKIE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ANONYMIZE_INSERT_CLIENT_IP), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_RESPONSE_SERVER_ENABLED), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_INSERT_SQUID_X_FORWARDED_FOR), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_SERVER_TCP_INIT_CWND), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_SEND_HTTP11_REQUESTS), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_HTTP), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_CLUSTER_CACHE_LOCAL), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_CLIENT_NO_CACHE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IMS_ON_CLIENT_NO_CACHE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_SERVER_NO_CACHE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_REQUIRED_HEADERS), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_INSERT_REQUEST_VIA_STR), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_HEURISTIC_MIN_LIFETIME), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_HEURISTIC_MAX_LIFETIME), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_MAX_STALE_AGE), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_IN), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_TRANSACTION_NO_ACTIVITY_TIMEOUT_IN), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_TRANSACTION_NO_ACTIVITY_TIMEOUT_OUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_OUT), - TS_LUA_MAKE_
[trafficserver] 01/01: Merge pull request #596 from zizhong/62fe5835
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git commit 2d6d7eb7be507197527e4c85f2b6833ddef2543d Merge: ba22efd f30ae30 Author: Brian Geffon AuthorDate: Fri Apr 22 09:48:56 2016 +0800 Merge pull request #596 from zizhong/62fe5835 TS-3922: Websocket Timeouts, transaction overrideable .../api/functions/TSHttpOverridableConfig.en.rst | 2 ++ lib/ts/apidefs.h.in| 2 ++ proxy/InkAPI.cc| 10 ++ 3 files changed, 14 insertions(+) -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch master updated (ba22efd -> 2d6d7eb)
This is an automated email from the ASF dual-hosted git repository. briang pushed a change to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git. from ba22efd TS-4357: Remove SSLv2 and only allow SSLv3 to origin with configure option. adds f30ae30 WebSocket timeouts: transaction overrideable new 2d6d7eb Merge pull request #596 from zizhong/62fe5835 The 1 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: .../api/functions/TSHttpOverridableConfig.en.rst | 2 ++ lib/ts/apidefs.h.in| 2 ++ proxy/InkAPI.cc| 10 ++ 3 files changed, 14 insertions(+) -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-3922: clang format
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 518e829 TS-3922: clang format 518e829 is described below commit 518e829c90dbbd01ac424e8f693955102e9cde93 Author: Brian Geffon AuthorDate: Wed Apr 20 23:32:35 2016 -0700 TS-3922: clang format --- proxy/http/HttpSM.cc | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 745394e..2b7cddb 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -1586,14 +1586,16 @@ HttpSM::handle_api_return() HTTP_INCREMENT_DYN_STAT(http_websocket_current_active_client_connections_stat); if (ua_session) { - DebugSM("http_websocket", "(client session) Setting websocket active timeout=%" PRId64 "s and inactive timeout=%" PRId64 "s", + DebugSM("http_websocket", + "(client session) Setting websocket active timeout=%" PRId64 "s and inactive timeout=%" PRId64 "s", t_state.txn_conf->websocket_active_timeout, t_state.txn_conf->websocket_inactive_timeout); ua_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_active_timeout)); ua_session->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_inactive_timeout)); } if (server_session) { - DebugSM("http_websocket", "(server session) Setting websocket active timeout=%" PRId64 "s and inactive timeout=%" PRId64 "s", + DebugSM("http_websocket", + "(server session) Setting websocket active timeout=%" PRId64 "s and inactive timeout=%" PRId64 "s", t_state.txn_conf->websocket_active_timeout, t_state.txn_conf->websocket_inactive_timeout); server_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_active_timeout)); server_session->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_inactive_timeout)); -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-3922: Fix format warning
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 25e650b TS-3922: Fix format warning 25e650b is described below commit 25e650b95c0e2644b7fb1a161a1f43e5827d858f Author: Brian Geffon AuthorDate: Wed Apr 20 22:46:51 2016 -0700 TS-3922: Fix format warning --- proxy/http/HttpSM.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 0d27e23..745394e 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -1586,14 +1586,14 @@ HttpSM::handle_api_return() HTTP_INCREMENT_DYN_STAT(http_websocket_current_active_client_connections_stat); if (ua_session) { - DebugSM("http_websocket", "(client session) Setting websocket active timeout=%ld s and inactive timeout=%ld s", + DebugSM("http_websocket", "(client session) Setting websocket active timeout=%" PRId64 "s and inactive timeout=%" PRId64 "s", t_state.txn_conf->websocket_active_timeout, t_state.txn_conf->websocket_inactive_timeout); ua_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_active_timeout)); ua_session->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_inactive_timeout)); } if (server_session) { - DebugSM("http_websocket", "(server session) Setting websocket active timeout=%ld s and inactive timeout=%ld s", + DebugSM("http_websocket", "(server session) Setting websocket active timeout=%" PRId64 "s and inactive timeout=%" PRId64 "s", t_state.txn_conf->websocket_active_timeout, t_state.txn_conf->websocket_inactive_timeout); server_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_active_timeout)); server_session->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->websocket_inactive_timeout)); -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-4365: Fixing two remaining clang-analyzer warnings
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 656acaf TS-4365: Fixing two remaining clang-analyzer warnings 656acaf is described below commit 656acafdd61bfe0df550bb50d608341f28a60eca Author: Brian Geffon AuthorDate: Wed Apr 20 22:38:04 2016 -0700 TS-4365: Fixing two remaining clang-analyzer warnings --- lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc| 5 ++--- .../examples/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc b/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc index 7cd8e63..b027a73 100644 --- a/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc +++ b/lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc @@ -98,9 +98,7 @@ public: { Async::execute(this, new AsyncHttpFetch("http://127.0.0.1/";), getMutex()); ++num_fetches_pending_; -AsyncHttpFetch *post_request = new AsyncHttpFetch("http://127.0.0.1/post";, "data"); - -(void)post_request; +post_request_ = new AsyncHttpFetch("http://127.0.0.1/post";, "data"); Async::execute(this, new AsyncHttpFetch("http://127.0.0.1/post";, "data"), getMutex()); ++num_fetches_pending_; @@ -161,6 +159,7 @@ public: private: Transaction &transaction_; int num_fetches_pending_; + AsyncHttpFetch *post_request_; void handleAnyAsyncComplete(AsyncHttpFetch &async_http_fetch) diff --git a/lib/atscppapi/examples/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc b/lib/atscppapi/examples/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc index 350a98b..488270d 100644 --- a/lib/atscppapi/examples/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc +++ b/lib/atscppapi/examples/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc @@ -80,7 +80,7 @@ void TSPluginInit(int /* argc ATS_UNUSED */, const char * /* argv ATS_UNUSED */ []) { RegisterGlobalPlugin("CPP_Example_AsyncHttpFetchStreaming", "apache", "d...@trafficserver.apache.org"); - new InterceptInstaller(); + plugin = new InterceptInstaller(); } void -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: Fix typo in README
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 780d237 Fix typo in README 780d237 is described below commit 780d237a03d69d37ff06848fddebe5cc1ce11b43 Author: Brian Geffon AuthorDate: Wed Apr 20 21:42:41 2016 -0700 Fix typo in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 3d7756b..4ff28f5 100644 --- a/README +++ b/README @@ -30,7 +30,7 @@ plugins to build large scale web applications. |-- hostdb/ Internal DNS cache |-- net/ ... Network |-- lib/ ... - |-- cpp11api ... C++ '11 wrapper for plugin developers + |-- atscppapi/ ... C++ api wrapper for plugin developers |-- records/ ... library for config files |-- perl/ .. Perl libraries for e.g. mgmt access and configurations |-- ts/ Base / core library -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-3922: Add independent websocket timeouts. This closes #590
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 1466cca TS-3922: Add independent websocket timeouts. This closes #590 1466cca is described below commit 1466ccadd2c3cee31de9835249bf24f29a1d9ea1 Author: Brian Geffon AuthorDate: Wed Apr 20 21:32:03 2016 -0700 TS-3922: Add independent websocket timeouts. This closes #590 --- doc/admin-guide/files/records.config.en.rst | 12 iocore/net/UnixNet.cc | 9 + mgmt/RecordsConfig.cc | 4 proxy/http/HttpConfig.cc| 5 + proxy/http/HttpConfig.h | 16 +--- proxy/http/HttpSM.cc| 14 ++ 6 files changed, 49 insertions(+), 11 deletions(-) diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst index b3421ba..a5f5889 100644 --- a/doc/admin-guide/files/records.config.en.rst +++ b/doc/admin-guide/files/records.config.en.rst @@ -1121,6 +1121,18 @@ HTTP Connection Timeouts Specifies how long Traffic Server keeps connections to origin servers open if the transaction stalls. +.. ts:cv:: CONFIG proxy.config.websocket.no_activity_timeout INT 600 + :reloadable: + :overridable: + + Specifies how long Traffic Server keeps connections open if a websocket stalls. + +.. ts:cv:: CONFIG proxy.config.websocket.active_timeout INT 3600 + :reloadable: + :overridable: + + The maximum amount of time Traffic Server keeps websocket connections open. + .. ts:cv:: CONFIG proxy.config.http.transaction_active_timeout_in INT 900 :reloadable: diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc index d749844..5066b47 100644 --- a/iocore/net/UnixNet.cc +++ b/iocore/net/UnixNet.cc @@ -85,8 +85,9 @@ public: vc->set_inactivity_timeout(HRTIME_SECONDS(default_inactivity_timeout)); NET_INCREMENT_DYN_STAT(default_inactivity_timeout_stat); } else { -Debug("inactivity_cop_verbose", "vc: %p now: %" PRId64 " timeout at: %" PRId64 " timeout in: %" PRId64, vc, now, - ink_hrtime_to_sec(vc->next_inactivity_timeout_at), ink_hrtime_to_sec(vc->inactivity_timeout_in)); +Debug("inactivity_cop_verbose", "vc: %p now: %" PRId64 " timeout at: %" PRId64 " timeout in: %" PRId64, vc, + ink_hrtime_to_sec(now), ink_hrtime_to_sec(vc->next_inactivity_timeout_at), + ink_hrtime_to_sec(vc->inactivity_timeout_in)); } if (vc->next_inactivity_timeout_at && vc->next_inactivity_timeout_at < now) { @@ -96,8 +97,8 @@ public: NET_SUM_DYN_STAT(keep_alive_queue_timeout_total_stat, diff); NET_INCREMENT_DYN_STAT(keep_alive_queue_timeout_count_stat); } -Debug("inactivity_cop_verbose", "vc: %p now: %" PRId64 " timeout at: %" PRId64 " timeout in: %" PRId64, vc, now, - vc->next_inactivity_timeout_at, vc->inactivity_timeout_in); +Debug("inactivity_cop_verbose", "vc: %p now: %" PRId64 " timeout at: %" PRId64 " timeout in: %" PRId64, vc, + ink_hrtime_to_sec(now), vc->next_inactivity_timeout_at, vc->inactivity_timeout_in); vc->handleEvent(EVENT_IMMEDIATE, e); } } diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 55d9cdc..0ce9df9 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -539,6 +539,10 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.keep_alive_no_activity_timeout_out", RECD_INT, "120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} , + {RECT_CONFIG, "proxy.config.websocket.no_activity_timeout", RECD_INT, "600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} + , + {RECT_CONFIG, "proxy.config.websocket.active_timeout", RECD_INT, "3600", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} + , {RECT_CONFIG, "proxy.config.http.transaction_no_activity_timeout_in", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} , {RECT_CONFIG, "proxy.config.http.transaction_no_activity_timeout_out", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index 3ab4a88..885ff3c 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -942,6 +942,9 @@ HttpConfig::startup()
[trafficserver] branch master updated: TS-4369: Add VIA_ERROR_MOVED_TEMPORARILY. This closes #586
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new af7832d TS-4369: Add VIA_ERROR_MOVED_TEMPORARILY. This closes #586 af7832d is described below commit af7832d229d6746edfd5010ab013fce0bbf20c21 Author: Brian Geffon AuthorDate: Wed Apr 20 21:26:59 2016 -0700 TS-4369: Add VIA_ERROR_MOVED_TEMPORARILY. This closes #586 --- cmd/traffic_via/traffic_via.cc | 1 + doc/appendices/faq.en.rst | 1 + proxy/http/HttpTransact.cc | 2 +- proxy/http/HttpTransact.h | 1 + proxy/http/README.via | 3 +++ 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/traffic_via/traffic_via.cc b/cmd/traffic_via/traffic_via.cc index 82b9ad3..c816f5a 100644 --- a/cmd/traffic_via/traffic_via.cc +++ b/cmd/traffic_via/traffic_via.cc @@ -176,6 +176,7 @@ standardViaLookup(char flag) viaTable->viaData[(unsigned char)'N'] = "no error"; viaTable->viaData[(unsigned char)'F'] = "request forbidden"; viaTable->viaData[(unsigned char)'R'] = "cache read error"; +viaTable->viaData[(unsigned char)'M'] = "moved temporarily"; viaTable->viaData[(unsigned char)' '] = "unknown"; break; default: diff --git a/doc/appendices/faq.en.rst b/doc/appendices/faq.en.rst index d8646c5..4951403 100644 --- a/doc/appendices/faq.en.rst +++ b/doc/appendices/faq.en.rst @@ -229,6 +229,7 @@ F request forbidden H header syntax unacceptable N no error R cache read error +M moved temporarily S server related error T connection timed out = == diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 867ad2a..aa3f143 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -8135,7 +8135,7 @@ HttpTransact::build_error_response(State *s, HTTPStatus status_code, const char SET_VIA_STRING(VIA_ERROR_TYPE, VIA_ERROR_DNS_FAILURE); break; case HTTP_STATUS_MOVED_TEMPORARILY: -SET_VIA_STRING(VIA_ERROR_TYPE, VIA_ERROR_SERVER); +SET_VIA_STRING(VIA_ERROR_TYPE, VIA_ERROR_MOVED_TEMPORARILY); break; case HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: SET_VIA_STRING(VIA_CLIENT_REQUEST, VIA_CLIENT_ERROR); diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h index 5173229..ad9acea 100644 --- a/proxy/http/HttpTransact.h +++ b/proxy/http/HttpTransact.h @@ -183,6 +183,7 @@ enum ViaString_t { VIA_ERROR_SERVER = 'S', VIA_ERROR_TIMEOUT = 'T', VIA_ERROR_CACHE_READ = 'R', + VIA_ERROR_MOVED_TEMPORARILY = 'M', // // Now the detailed stuff // diff --git a/proxy/http/README.via b/proxy/http/README.via index c5c954f..04c4a81 100644 --- a/proxy/http/README.via +++ b/proxy/http/README.via @@ -12,6 +12,7 @@ Ain cache, not acceptable Sin cache, stale Hin cache, fresh + Rin cache, fresh RAM hit server stuff Eerror in response @@ -35,6 +36,8 @@ Ddns failure Frequest forbidden Hheader syntax unacceptable + Mmoved temporarily + Rcache read error Sserver related error Tconnection timed out -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated (0bd26e9 -> ba33d1c)
This is an automated email from the ASF dual-hosted git repository. briang pushed a change to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git. from 0bd26e9 Merge pull request #587 from zizhong/bad_comma adds c953da0 TS-4365: Prevent invalid clang-analyzer memory leak warnings in atscppapi new ba33d1c Merge pull request #592 from bgaff/TS-4365 The 1 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: lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc | 9 ++--- .../async_http_fetch_streaming/AsyncHttpFetchStreaming.cc | 5 + lib/atscppapi/examples/async_timer/AsyncTimer.cc | 6 ++ lib/atscppapi/examples/boom/boom.cc| 7 ++- lib/atscppapi/examples/clientredirect/ClientRedirect.cc| 7 ++- lib/atscppapi/examples/clientrequest/ClientRequest.cc | 7 ++- .../custom_error_remap_plugin/CustomErrorRemapPlugin.cc| 7 ++- lib/atscppapi/examples/customresponse/CustomResponse.cc| 7 ++- lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc | 7 ++- .../examples/gzip_transformation/GzipTransformationPlugin.cc | 7 ++- lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc | 9 - lib/atscppapi/examples/intercept/intercept.cc | 7 ++- .../InternalTransactionHandling.cc | 10 -- lib/atscppapi/examples/logger_example/LoggerExample.cc | 3 ++- .../MultipleTransactionHookPlugins.cc | 6 +- .../null_transformation_plugin/NullTransformationPlugin.cc | 3 ++- lib/atscppapi/examples/post_buffer/PostBuffer.cc | 7 ++- lib/atscppapi/examples/remap_plugin/RemapPlugin.cc | 7 ++- lib/atscppapi/examples/serverresponse/ServerResponse.cc| 7 ++- lib/atscppapi/examples/stat_example/StatExample.cc | 4 +++- lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc | 7 ++- .../examples/transactionhook/TransactionHookPlugin.cc | 7 ++- 22 files changed, 123 insertions(+), 23 deletions(-) -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] 01/01: Merge pull request #592 from bgaff/TS-4365
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git commit ba33d1cbf6508e04d4a5164ab40e49fb577ce267 Merge: 0bd26e9 c953da0 Author: Brian Geffon AuthorDate: Thu Apr 21 11:49:12 2016 +0800 Merge pull request #592 from bgaff/TS-4365 TS-4365: Prevent invalid clang-analyzer memory leak warnings lib/atscppapi/examples/async_http_fetch/AsyncHttpFetch.cc | 9 ++--- .../async_http_fetch_streaming/AsyncHttpFetchStreaming.cc | 5 + lib/atscppapi/examples/async_timer/AsyncTimer.cc | 6 ++ lib/atscppapi/examples/boom/boom.cc| 7 ++- lib/atscppapi/examples/clientredirect/ClientRedirect.cc| 7 ++- lib/atscppapi/examples/clientrequest/ClientRequest.cc | 7 ++- .../custom_error_remap_plugin/CustomErrorRemapPlugin.cc| 7 ++- lib/atscppapi/examples/customresponse/CustomResponse.cc| 7 ++- lib/atscppapi/examples/globalhook/GlobalHookPlugin.cc | 7 ++- .../examples/gzip_transformation/GzipTransformationPlugin.cc | 7 ++- lib/atscppapi/examples/helloworld/HelloWorldPlugin.cc | 9 - lib/atscppapi/examples/intercept/intercept.cc | 7 ++- .../InternalTransactionHandling.cc | 10 -- lib/atscppapi/examples/logger_example/LoggerExample.cc | 3 ++- .../MultipleTransactionHookPlugins.cc | 6 +- .../null_transformation_plugin/NullTransformationPlugin.cc | 3 ++- lib/atscppapi/examples/post_buffer/PostBuffer.cc | 7 ++- lib/atscppapi/examples/remap_plugin/RemapPlugin.cc | 7 ++- lib/atscppapi/examples/serverresponse/ServerResponse.cc| 7 ++- lib/atscppapi/examples/stat_example/StatExample.cc | 4 +++- lib/atscppapi/examples/timeout_example/TimeoutExamplePlugin.cc | 7 ++- .../examples/transactionhook/TransactionHookPlugin.cc | 7 ++- 22 files changed, 123 insertions(+), 23 deletions(-) -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch master updated (3d7cdbf -> 0bd26e9)
This is an automated email from the ASF dual-hosted git repository. briang pushed a change to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git. from 3d7cdbf TS-4147 Allow gzip plugin to be a remap plugin adds 24d6365 removing a bad comma new 0bd26e9 Merge pull request #587 from zizhong/bad_comma The 1 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: proxy/api/ts/experimental.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] 01/01: Merge pull request #587 from zizhong/bad_comma
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git commit 0bd26e984743fa94757e8310dbeea9d3b4463dd8 Merge: 3d7cdbf 24d6365 Author: Brian Geffon AuthorDate: Wed Apr 20 10:39:14 2016 +0800 Merge pull request #587 from zizhong/bad_comma removing a bad comma proxy/api/ts/experimental.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch master updated: TS-4312 Clang format
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 900dab0 TS-4312 Clang format 900dab0 is described below commit 900dab078b12a5afe7567fe6d24fbf16879594a0 Author: Brian Geffon AuthorDate: Sun Apr 17 10:06:57 2016 -0700 TS-4312 Clang format --- proxy/hdrs/URL.cc | 1 - proxy/hdrs/URL.h| 3 ++- proxy/http/HttpConfig.h | 10 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/proxy/hdrs/URL.cc b/proxy/hdrs/URL.cc index 0aff2c1..bc3851d 100644 --- a/proxy/hdrs/URL.cc +++ b/proxy/hdrs/URL.cc @@ -1817,7 +1817,6 @@ REGRESSION_TEST(VALIDATE_HDR_FIELD)(RegressionTest *t, int /* level ATS_UNUSED * } } - REGRESSION_TEST(ParseRules_strict_URI)(RegressionTest *t, int /* level ATS_UNUSED */, int *pstatus) { const struct { diff --git a/proxy/hdrs/URL.h b/proxy/hdrs/URL.h index a68edca..ef4db3a 100644 --- a/proxy/hdrs/URL.h +++ b/proxy/hdrs/URL.h @@ -236,7 +236,8 @@ void url_params_set(HdrHeap *heap, URLImpl *url, const char *value, int length, void url_query_set(HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string); void url_fragment_set(HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string); -MIMEParseResult url_parse(HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings, bool strict_uri_parsing = false); +MIMEParseResult url_parse(HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings, + bool strict_uri_parsing = false); MIMEParseResult url_parse_no_path_component_breakdown(HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings); MIMEParseResult url_parse_internet(HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings); diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h index e43796e..824ea7c 100644 --- a/proxy/http/HttpConfig.h +++ b/proxy/http/HttpConfig.h @@ -858,11 +858,11 @@ inline HttpConfigParams::HttpConfigParams() parent_connect_attempts(4), per_parent_connect_attempts(2), parent_connect_timeout(30), anonymize_other_header_list(NULL), enable_http_stats(1), icp_enabled(0), stale_icp_enabled(0), cache_vary_default_text(NULL), cache_vary_default_images(NULL), cache_vary_default_other(NULL), cache_enable_default_vary_headers(0), cache_post_method(0), connect_ports_string(NULL), -connect_ports(NULL), push_method_enabled(0), referer_filter_enabled(0), referer_format_redirect(0), strict_uri_parsing(0), reverse_proxy_enabled(0), -url_remap_required(1), record_cop_page(0), errors_log_error_pages(1), enable_http_info(0), cluster_time_delta(0), -redirection_host_no_port(1), post_copy_size(2048), ignore_accept_mismatch(0), ignore_accept_language_mismatch(0), -ignore_accept_encoding_mismatch(0), ignore_accept_charset_mismatch(0), send_100_continue_response(0), -disallow_post_100_continue(0), parser_allow_non_http(1), max_post_size(0), +connect_ports(NULL), push_method_enabled(0), referer_filter_enabled(0), referer_format_redirect(0), strict_uri_parsing(0), +reverse_proxy_enabled(0), url_remap_required(1), record_cop_page(0), errors_log_error_pages(1), enable_http_info(0), +cluster_time_delta(0), redirection_host_no_port(1), post_copy_size(2048), ignore_accept_mismatch(0), +ignore_accept_language_mismatch(0), ignore_accept_encoding_mismatch(0), ignore_accept_charset_mismatch(0), +send_100_continue_response(0), disallow_post_100_continue(0), parser_allow_non_http(1), max_post_size(0), server_session_sharing_pool(TS_SERVER_SESSION_SHARING_POOL_THREAD), synthetic_port(0) { } -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: TS-4312 Add config to strictly parse URL according to RFC 3986. This closes #574
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 9f9dc38 TS-4312 Add config to strictly parse URL according to RFC 3986. This closes #574 9f9dc38 is described below commit 9f9dc3832d16a79072e1f9c7abf69048e58535cc Author: Shen Zhang AuthorDate: Sun Apr 17 09:55:34 2016 -0700 TS-4312 Add config to strictly parse URL according to RFC 3986. This closes #574 --- doc/admin-guide/files/records.config.en.rst | 5 +++ lib/ts/CompileParseRules.cc | 4 +- lib/ts/ParseRules.h | 39 --- mgmt/RecordsConfig.cc | 2 + proxy/hdrs/HTTP.cc | 6 +-- proxy/hdrs/HTTP.h | 10 ++--- proxy/hdrs/HdrTSOnly.cc | 4 +- proxy/hdrs/URL.cc | 59 - proxy/hdrs/URL.h| 2 +- proxy/http/HttpConfig.cc| 3 ++ proxy/http/HttpConfig.h | 4 +- proxy/http/HttpSM.cc| 3 +- 12 files changed, 120 insertions(+), 21 deletions(-) diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst index 55ac374..b3421ba 100644 --- a/doc/admin-guide/files/records.config.en.rst +++ b/doc/admin-guide/files/records.config.en.rst @@ -1040,6 +1040,11 @@ Value Effect An arbitrary string value that, if set, will be used to replace any request ``User-Agent`` header. +.. ts:cv:: CONFIG proxy.config.http.strict_uri_parsing INT 0 + + Enables (``1``) or disables (``0``) Traffic Server to return a 400 Bad Request + if client's request URI includes character which is not RFC 3986 compliant + Parent Proxy Configuration == diff --git a/lib/ts/CompileParseRules.cc b/lib/ts/CompileParseRules.cc index efb39a0..7d92bb0 100644 --- a/lib/ts/CompileParseRules.cc +++ b/lib/ts/CompileParseRules.cc @@ -105,8 +105,8 @@ main() tparseRulesCType[c] |= is_eow_BIT; if (ParseRules::is_token(c)) tparseRulesCType[c] |= is_token_BIT; -if (ParseRules::is_wildmat(c)) - tparseRulesCType[c] |= is_wildmat_BIT; +if (ParseRules::is_uri(c)) + tparseRulesCType[c] |= is_uri_BIT; if (ParseRules::is_sep(c)) tparseRulesCType[c] |= is_sep_BIT; if (ParseRules::is_empty(c)) diff --git a/lib/ts/ParseRules.h b/lib/ts/ParseRules.h index 2b430cf..5e8f8d6 100644 --- a/lib/ts/ParseRules.h +++ b/lib/ts/ParseRules.h @@ -59,7 +59,7 @@ typedef unsigned int CTypeResult; #define is_wslfcr_BIT (1 << 20) #define is_eow_BIT (1 << 21) #define is_token_BIT (1 << 22) -#define is_wildmat_BIT (1 << 23) +#define is_uri_BIT (1 << 23) #define is_sep_BIT (1 << 24) #define is_empty_BIT (1 << 25) #define is_alnum_BIT (1 << 26) @@ -122,7 +122,7 @@ public: static CTypeResult is_punct(char c);// !"#$%&'()*+,-./:;<>=?@_{}|~ static CTypeResult is_end_of_url(char c); // NUL,CR,SP static CTypeResult is_eow(char c); // NUL,CR,LF - static CTypeResult is_wildmat(char c); // \,*,?,[ + static CTypeResult is_uri(char c); // A-Z,a-z,0-9 :/?#[]@!$&'()*+,;=-._~% static CTypeResult is_sep(char c); // NULL,COMMA,':','!',wslfcr static CTypeResult is_empty(char c);// wslfcr,# static CTypeResult is_alnum(char c);// 0-9,A-Z,a-z @@ -590,12 +590,41 @@ ParseRules::is_eow(char c) } inline CTypeResult -ParseRules::is_wildmat(char c) +ParseRules::is_uri(char c) { #ifndef COMPILE_PARSE_RULES - return (parseRulesCType[(unsigned char)c] & is_wildmat_BIT); + return (parseRulesCType[(unsigned char)c] & is_uri_BIT); #else - return (c == '*' || c == '?' || c == '[' || c == '\\'); + if (is_alnum(c)) +return (true); + + switch (c) { + case ':': + case '/': + case '?': + case '#': + case '[': + case ']': + case '@': + case '!': + case '$': + case '&': + case '\'': + case '(': + case ')': + case '*': + case '+': + case ',': + case ';': + case '=': + case '-': + case '.': + case '_': + case '~': + case '%': +return (true); + } + return (false); #endif } diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 8d17edb..55d9cdc 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -440,6 +440,8 @@ static const RecordElement RecordsConfig[] = , {REC
[trafficserver] branch master updated: TS-4340: fix small issue related to match typ e NONE
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 8d4c256 TS-4340: fix small issue related to match typ e NONE 8d4c256 is described below commit 8d4c25653bb038f70651b8675a5969e522668d43 Author: Brian Geffon AuthorDate: Thu Mar 3 15:45:41 2016 -0800 TS-4340: fix small issue related to match typ e NONE --- proxy/http/HttpConnectionCount.h | 8 proxy/http/HttpServerSession.cc | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/proxy/http/HttpConnectionCount.h b/proxy/http/HttpConnectionCount.h index b025e8f..eea0d1a 100644 --- a/proxy/http/HttpConnectionCount.h +++ b/proxy/http/HttpConnectionCount.h @@ -58,6 +58,10 @@ public: int getCount(const IpEndpoint &addr, const INK_MD5 &hostname_hash, TSServerSessionSharingMatchType match_type) { +if (TS_SERVER_SESSION_SHARING_MATCH_NONE == match_type) { + return 0; // We can never match a node if match type is NONE +} + ink_mutex_acquire(&_mutex); int count = _hostCount.get(ConnAddr(addr, hostname_hash, match_type)); ink_mutex_release(&_mutex); @@ -73,6 +77,10 @@ public: incrementCount(const IpEndpoint &addr, const INK_MD5 &hostname_hash, TSServerSessionSharingMatchType match_type, const int delta = 1) { +if (TS_SERVER_SESSION_SHARING_MATCH_NONE == match_type) { + return; // We can never match a node if match type is NONE. +} + ConnAddr caddr(addr, hostname_hash, match_type); ink_mutex_acquire(&_mutex); int count = _hostCount.get(caddr); diff --git a/proxy/http/HttpServerSession.cc b/proxy/http/HttpServerSession.cc index 763c6b8..d2f2386 100644 --- a/proxy/http/HttpServerSession.cc +++ b/proxy/http/HttpServerSession.cc @@ -140,14 +140,14 @@ HttpServerSession::do_io_close(int alerrno) // Check to see if we are limiting the number of connections // per host if (enable_origin_connection_limiting == true) { -if (connection_count->getCount(server_ip, hostname_hash, sharing_match) > 0) { +if (connection_count->getCount(server_ip, hostname_hash, sharing_match) >= 0) { connection_count->incrementCount(server_ip, hostname_hash, sharing_match, -1); ip_port_text_buffer addrbuf; Debug("http_ss", "[%" PRId64 "] connection closed, ip: %s, count: %u", con_id, ats_ip_nptop(&server_ip.sa, addrbuf, sizeof(addrbuf)), connection_count->getCount(server_ip, hostname_hash, sharing_match)); } else { - Error("[%" PRId64 "] number of connections should be greater than zero: %u", con_id, + Error("[%" PRId64 "] number of connections should be greater than or equal to zero: %u", con_id, connection_count->getCount(server_ip, hostname_hash, sharing_match)); } } -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated (a387890 -> 764749b)
This is an automated email from the ASF dual-hosted git repository. briang pushed a change to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git. from a387890 TS-4287: Add a simple and unavailable server retry feature to Parent Selection. adds c16f20d TS-4340: Fix origin max connections new 764749b Merge pull request #569 from bgaff/TS-4340 The 1 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: lib/ts/ink_inet.cc | 20 lib/ts/ink_inet.h| 2 + proxy/http/HttpConnectionCount.h | 98 proxy/http/HttpSM.cc | 14 -- proxy/http/HttpServerSession.cc | 19 proxy/http/HttpSessionManager.cc | 4 +- 6 files changed, 135 insertions(+), 22 deletions(-) -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] 01/01: Merge pull request #569 from bgaff/TS-4340
This is an automated email from the ASF dual-hosted git repository. briang pushed a commit to branch master in repository https://git-dual.apache.org/repos/asf/trafficserver.git commit 764749b38e2d9f52a42b5ad53ed204e2879987c9 Merge: a387890 c16f20d Author: Brian Geffon AuthorDate: Thu Apr 14 10:50:26 2016 -0700 Merge pull request #569 from bgaff/TS-4340 TS-4340: Fix origin max connections lib/ts/ink_inet.cc | 20 lib/ts/ink_inet.h| 2 + proxy/http/HttpConnectionCount.h | 98 proxy/http/HttpSM.cc | 14 -- proxy/http/HttpServerSession.cc | 19 proxy/http/HttpSessionManager.cc | 4 +- 6 files changed, 135 insertions(+), 22 deletions(-) -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[2/2] trafficserver git commit: TS-4064: Customizable congestion control algorithms: DOCS
TS-4064: Customizable congestion control algorithms: DOCS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/500b3c5e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/500b3c5e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/500b3c5e Branch: refs/heads/master Commit: 500b3c5e0f3642ebb42ba511340c53553f9d6be9 Parents: 038b189 Author: Brian Geffon Authored: Tue Jan 5 03:01:57 2016 -0800 Committer: Brian Geffon Committed: Tue Jan 5 03:02:29 2016 -0800 -- doc/admin-guide/files/records.config.en.rst | 12 1 file changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/500b3c5e/doc/admin-guide/files/records.config.en.rst -- diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst index d313b78..51f14f5 100644 --- a/doc/admin-guide/files/records.config.en.rst +++ b/doc/admin-guide/files/records.config.en.rst @@ -2857,6 +2857,18 @@ Sockets If it is set to -1, Traffic Server will automatically set this to a platform-specific maximum. +.. ts:cv:: CONFIG proxy.config.net.tcp_congestion_control_in STRING "" + + This directive will override the congestion control algorithm for incoming + connections (accept sockets). On linux the allowed values are typically + specified in a space seperated list in /proc/sys/net/ipv4/tcp_allowed_congestion_control + +.. ts:cv:: CONFIG proxy.config.net.tcp_congestion_control_out STRING "" + + This directive will override the congestion control algorithm for outgoing + connections (connect sockets). On linux the allowed values are typically + specified in a space seperated list in /proc/sys/net/ipv4/tcp_allowed_congestion_control + .. ts:cv:: CONFIG proxy.config.net.sock_send_buffer_size_in INT 0 Sets the send buffer size for connections from the client to Traffic Server.
[1/2] trafficserver git commit: TS-4064: Customizable congestion control algorithms
Repository: trafficserver Updated Branches: refs/heads/master a70e9473c -> 500b3c5e0 TS-4064: Customizable congestion control algorithms Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/038b189d Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/038b189d Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/038b189d Branch: refs/heads/master Commit: 038b189d62e8100a656e674e6ed4fd611ba32d6f Parents: a70e947 Author: Brian Geffon Authored: Tue Jan 5 02:37:04 2016 -0800 Committer: Brian Geffon Committed: Tue Jan 5 03:02:28 2016 -0800 -- iocore/net/I_NetVConnection.h | 3 +++ iocore/net/P_UnixNetVConnection.h | 20 mgmt/RecordsConfig.cc | 4 proxy/PluginVC.cc | 6 ++ proxy/PluginVC.h | 2 ++ proxy/http/HttpClientSession.cc | 8 proxy/http/HttpServerSession.cc | 8 7 files changed, 51 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/iocore/net/I_NetVConnection.h -- diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h index 79e2dac..0dcda03 100644 --- a/iocore/net/I_NetVConnection.h +++ b/iocore/net/I_NetVConnection.h @@ -518,6 +518,9 @@ public: /** Set the TCP initial congestion window */ virtual int set_tcp_init_cwnd(int init_cwnd) = 0; + /** Set the TCP congestion control algorithm */ + virtual int set_tcp_congestion_control(const char *name, int len) = 0; + /** Set local sock addr struct. */ virtual void set_local_addr() = 0; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/iocore/net/P_UnixNetVConnection.h -- diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h index 968b0b9..5c20d13 100644 --- a/iocore/net/P_UnixNetVConnection.h +++ b/iocore/net/P_UnixNetVConnection.h @@ -291,6 +291,7 @@ public: virtual void set_local_addr(); virtual void set_remote_addr(); virtual int set_tcp_init_cwnd(int init_cwnd); + virtual int set_tcp_congestion_control(const char *name, int len); virtual void apply_options(); friend void write_to_net_io(NetHandler *, UnixNetVConnection *, EThread *); @@ -452,6 +453,25 @@ UnixNetVConnection::set_tcp_init_cwnd(int init_cwnd) #endif } +TS_INLINE int +UnixNetVConnection::set_tcp_congestion_control(const char *name, int len) +{ +#ifdef TCP_CONGESTION + int rv = 0; + rv = setsockopt(con.fd, IPPROTO_TCP, TCP_CONGESTION, reinterpret_cast(const_cast(name)), len); + if (rv < 0) { +Error("Unable to set TCP congestion control on socket %d to \"%.*s\", errno=%d (%s)", con.fd, len, name, errno, + strerror(errno)); + } else { +Debug("socket", "Setting TCP congestion control on socket [%d] to \"%.*s\" -> %d", con.fd, len, name, rv); + } + return rv; +#else + Debug("socket", "Setting TCP congestion control %.*s is not supported on this platform.", len, name); + return -1; +#endif +} + TS_INLINE UnixNetVConnection::~UnixNetVConnection() { } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/mgmt/RecordsConfig.cc -- diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 34e180d..05d87f8 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -855,6 +855,10 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.net.sock_option_tfo_queue_size_in", RECD_INT, "1", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL} , + {RECT_CONFIG, "proxy.config.net.tcp_congestion_control_in", RECD_STRING, "", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL} + , + {RECT_CONFIG, "proxy.config.net.tcp_congestion_control_out", RECD_STRING, "", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL} + , //## //# http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/proxy/PluginVC.cc -- diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc index 25efaf9..b0a5e92 100644 --- a/proxy/PluginVC.cc +++ b/proxy/PluginVC.cc @@ -907,6 +907,12 @@ PluginVC::set_tcp_init_cwnd(int /* init_cwnd ATS_UNUSED */) return -1; } +int +PluginVC::set_tcp_congestion_control(const char *ATS_UNUSED, int ATS_UNUSED) +{ + return -1; +} + void PluginVC::apply_options() { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/proxy/PluginVC.h -- diff --git a/proxy/PluginVC.h b/proxy/PluginVC.h index b4
trafficserver git commit: TS-4034: Minor atscppapi cleanup
Repository: trafficserver Updated Branches: refs/heads/master 9dc6dabed -> def017b4b TS-4034: Minor atscppapi cleanup Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/def017b4 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/def017b4 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/def017b4 Branch: refs/heads/master Commit: def017b4b19619497dcc378595494b97cbc9eb27 Parents: 9dc6dab Author: Brian Geffon Authored: Thu Nov 19 09:57:27 2015 -0800 Committer: Brian Geffon Committed: Thu Nov 19 09:57:27 2015 -0800 -- .../src/CaseInsensitiveStringComparator.cc | 44 +++- lib/atscppapi/src/GzipDeflateTransformation.cc | 2 +- lib/atscppapi/src/GzipInflateTransformation.cc | 2 +- lib/atscppapi/src/TransformationPlugin.cc | 2 +- lib/atscppapi/src/Url.cc| 11 +++-- 5 files changed, 14 insertions(+), 47 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/def017b4/lib/atscppapi/src/CaseInsensitiveStringComparator.cc -- diff --git a/lib/atscppapi/src/CaseInsensitiveStringComparator.cc b/lib/atscppapi/src/CaseInsensitiveStringComparator.cc index 34c7eac..67eaaed 100644 --- a/lib/atscppapi/src/CaseInsensitiveStringComparator.cc +++ b/lib/atscppapi/src/CaseInsensitiveStringComparator.cc @@ -20,17 +20,16 @@ * @file CaseInsensitiveStringComparator.cc */ +#include #include "atscppapi/CaseInsensitiveStringComparator.h" -namespace -{ -static char NORMALIZED_CHARACTERS[256]; -static volatile bool normalizer_initialized(false); -} - using atscppapi::CaseInsensitiveStringComparator; using std::string; +/** + * This class should eventually be removed, but because it's in a public API we cannot remove + * it until the next major release. + */ bool CaseInsensitiveStringComparator::operator()(const string &lhs, const string &rhs) const { return (compare(lhs, rhs) < 0); @@ -39,36 +38,5 @@ bool CaseInsensitiveStringComparator::operator()(const string &lhs, const string int CaseInsensitiveStringComparator::compare(const string &lhs, const string &rhs) const { - if (!normalizer_initialized) { -// this initialization is safe to execute in concurrent threads - hence no locking -for (int i = 0; i < 256; ++i) { - NORMALIZED_CHARACTERS[i] = static_cast(i); -} -for (unsigned char i = 'A'; i < 'Z'; ++i) { - NORMALIZED_CHARACTERS[i] = 'a' + (i - 'A'); -} -normalizer_initialized = true; - } - size_t lhs_size = lhs.size(); - size_t rhs_size = rhs.size(); - if ((lhs_size > 0) && (rhs_size > 0)) { -size_t num_chars_to_compare = (lhs_size < rhs_size) ? lhs_size : rhs_size; -for (size_t i = 0; i < num_chars_to_compare; ++i) { - unsigned char normalized_lhs_char = NORMALIZED_CHARACTERS[static_cast(lhs[i])]; - unsigned char normalized_rhs_char = NORMALIZED_CHARACTERS[static_cast(rhs[i])]; - if (normalized_lhs_char < normalized_rhs_char) { -return -1; - } - if (normalized_lhs_char > normalized_rhs_char) { -return 1; - } -} - } - if (lhs_size < rhs_size) { -return -1; - } - if (lhs_size > rhs_size) { -return 1; - } - return 0; // both strings are equal + return strcasecmp(lhs.c_str(), rhs.c_str()); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/def017b4/lib/atscppapi/src/GzipDeflateTransformation.cc -- diff --git a/lib/atscppapi/src/GzipDeflateTransformation.cc b/lib/atscppapi/src/GzipDeflateTransformation.cc index d375856..3bc8a11 100644 --- a/lib/atscppapi/src/GzipDeflateTransformation.cc +++ b/lib/atscppapi/src/GzipDeflateTransformation.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "atscppapi/TransformationPlugin.h" #include "atscppapi/GzipDeflateTransformation.h" #include "logging_internal.h" http://git-wip-us.apache.org/repos/asf/trafficserver/blob/def017b4/lib/atscppapi/src/GzipInflateTransformation.cc -- diff --git a/lib/atscppapi/src/GzipInflateTransformation.cc b/lib/atscppapi/src/GzipInflateTransformation.cc index a6424a7..31b6473 100644 --- a/lib/atscppapi/src/GzipInflateTransformation.cc +++ b/lib/atscppapi/src/GzipInflateTransformation.cc @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "atscppapi/TransformationPlugin.h" #include "atscppapi/GzipInflateTransformation.h" #include "logging_internal.h" http://git-wip-us.apache.org/repos/asf/trafficserver/blob/def017b4/lib/atscppapi/src/TransformationPlugin.cc
trafficserver git commit: Memory leak in Rule::socksParse(char*) when a token is missing the '=' sign. This closes #340
Repository: trafficserver Updated Branches: refs/heads/master 3de7c6fa9 -> 648e21574 Memory leak in Rule::socksParse(char*) when a token is missing the '=' sign. This closes #340 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/648e2157 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/648e2157 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/648e2157 Branch: refs/heads/master Commit: 648e215746369c069b9a5fde069dc750e8ee4f5b Parents: 3de7c6f Author: Can Selcik Authored: Tue Nov 17 09:18:47 2015 -0800 Committer: Brian Geffon Committed: Tue Nov 17 09:18:47 2015 -0800 -- mgmt/api/GenericParser.cc | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/648e2157/mgmt/api/GenericParser.cc -- diff --git a/mgmt/api/GenericParser.cc b/mgmt/api/GenericParser.cc index 66d18f4..770b2a6 100644 --- a/mgmt/api/GenericParser.cc +++ b/mgmt/api/GenericParser.cc @@ -623,6 +623,7 @@ Rule::socksParse(char *rule) // Every token must have a '=' sign if (numSubRuleTok < 2) { setErrorHint("'=' is expected in space-delimited token"); + delete m_tokenList; return NULL; }
trafficserver git commit: TS-4016: atscppapi Add the ability to skip the remap phase of the SM
Repository: trafficserver Updated Branches: refs/heads/master e5fed4006 -> 906d45ac0 TS-4016: atscppapi Add the ability to skip the remap phase of the SM Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/906d45ac Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/906d45ac Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/906d45ac Branch: refs/heads/master Commit: 906d45ac0715c6f1e9c931ca476e9875234cfc41 Parents: e5fed40 Author: Boaz Reicher Authored: Thu Nov 12 04:48:47 2015 -0800 Committer: Brian Geffon Committed: Thu Nov 12 04:48:47 2015 -0800 -- lib/atscppapi/src/Transaction.cc | 6 ++ lib/atscppapi/src/include/atscppapi/Transaction.h | 6 ++ 2 files changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/906d45ac/lib/atscppapi/src/Transaction.cc -- diff --git a/lib/atscppapi/src/Transaction.cc b/lib/atscppapi/src/Transaction.cc index 30b2806..b9396ef 100644 --- a/lib/atscppapi/src/Transaction.cc +++ b/lib/atscppapi/src/Transaction.cc @@ -288,6 +288,12 @@ Transaction::setCacheUrl(const string &cache_url) return (res == TS_SUCCESS); } +void +Transaction::setSkipRemapping(int flag) +{ + TSSkipRemappingSet(state_->txn_, flag); +} + const sockaddr * Transaction::getIncomingAddress() const { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/906d45ac/lib/atscppapi/src/include/atscppapi/Transaction.h -- diff --git a/lib/atscppapi/src/include/atscppapi/Transaction.h b/lib/atscppapi/src/include/atscppapi/Transaction.h index 805807b..02b3397 100644 --- a/lib/atscppapi/src/include/atscppapi/Transaction.h +++ b/lib/atscppapi/src/include/atscppapi/Transaction.h @@ -251,6 +251,12 @@ public: bool setCacheUrl(const std::string &); /** + * Ability to skip the remap phase of the State Machine + * This only really makes sense in TS_HTTP_READ_REQUEST_HDR_HOOK + */ + void setSkipRemapping(int); + + /** * The available types of timeouts you can set on a Transaction. */ enum TimeoutType {
trafficserver git commit: TS-4010: Add cached request/response to the CPP API transaction object
Repository: trafficserver Updated Branches: refs/heads/master 447ad332f -> e5fed4006 TS-4010: Add cached request/response to the CPP API transaction object Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e5fed400 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e5fed400 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e5fed400 Branch: refs/heads/master Commit: e5fed400699855ecb27e0e17cd0f2380daddcb70 Parents: 447ad33 Author: Boaz Reicher Authored: Wed Nov 11 21:17:30 2015 -0800 Committer: Brian Geffon Committed: Wed Nov 11 21:17:30 2015 -0800 -- lib/atscppapi/src/Transaction.cc| 51 +++- .../src/include/atscppapi/Transaction.h | 31 lib/atscppapi/src/include/utils_internal.h | 12 + lib/atscppapi/src/utils_internal.cc | 5 ++ 4 files changed, 98 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5fed400/lib/atscppapi/src/Transaction.cc -- diff --git a/lib/atscppapi/src/Transaction.cc b/lib/atscppapi/src/Transaction.cc index 7361cbd..30b2806 100644 --- a/lib/atscppapi/src/Transaction.cc +++ b/lib/atscppapi/src/Transaction.cc @@ -52,13 +52,20 @@ struct atscppapi::TransactionState : noncopyable { TSMBuffer client_response_hdr_buf_; TSMLoc client_response_hdr_loc_; Response client_response_; + TSMBuffer cached_response_hdr_buf_; + TSMLoc cached_response_hdr_loc_; + Response cached_response_; + TSMBuffer cached_request_hdr_buf_; + TSMLoc cached_request_hdr_loc_; + Request cached_request_; map > context_values_; TransactionState(TSHttpTxn txn, TSMBuffer client_request_hdr_buf, TSMLoc client_request_hdr_loc) : txn_(txn), client_request_hdr_buf_(client_request_hdr_buf), client_request_hdr_loc_(client_request_hdr_loc), client_request_(txn, client_request_hdr_buf, client_request_hdr_loc), server_request_hdr_buf_(NULL), server_request_hdr_loc_(NULL), server_response_hdr_buf_(NULL), server_response_hdr_loc_(NULL), client_response_hdr_buf_(NULL), - client_response_hdr_loc_(NULL){}; + client_response_hdr_loc_(NULL), cached_response_hdr_buf_(NULL), cached_response_hdr_loc_(NULL), cached_request_hdr_buf_(NULL), + cached_request_hdr_loc_(NULL){}; }; Transaction::Transaction(void *raw_txn) @@ -93,6 +100,14 @@ Transaction::~Transaction() LOG_DEBUG("Releasing client response"); TSHandleMLocRelease(state_->client_response_hdr_buf_, NULL_PARENT_LOC, state_->client_response_hdr_loc_); } + if (state_->cached_request_hdr_buf_ && state_->cached_request_hdr_loc_) { +LOG_DEBUG("Releasing cached request"); +TSHandleMLocRelease(state_->cached_request_hdr_buf_, NULL_PARENT_LOC, state_->cached_request_hdr_loc_); + } + if (state_->cached_response_hdr_buf_ && state_->cached_response_hdr_loc_) { +LOG_DEBUG("Releasing cached response"); +TSHandleMLocRelease(state_->cached_response_hdr_buf_, NULL_PARENT_LOC, state_->cached_response_hdr_loc_); + } delete state_; } @@ -238,6 +253,18 @@ Transaction::getClientResponse() return state_->client_response_; } +Request & +Transaction::getCachedRequest() +{ + return state_->cached_request_; +} + +Response & +Transaction::getCachedResponse() +{ + return state_->cached_response_; +} + string Transaction::getEffectiveUrl() { @@ -450,3 +477,25 @@ Transaction::initClientResponse() state_->client_response_.init(state_->client_response_hdr_buf_, state_->client_response_hdr_loc_); } } + +void +Transaction::initCachedRequest() +{ + static initializeHandles initializeCachedRequestHandles(TSHttpTxnCachedReqGet); + if (initializeCachedRequestHandles(state_->txn_, state_->cached_request_hdr_buf_, state_->cached_request_hdr_loc_, + "cached request")) { +LOG_DEBUG("Initializing cached request"); +state_->cached_request_.init(state_->cached_request_hdr_buf_, state_->cached_request_hdr_loc_); + } +} + +void +Transaction::initCachedResponse() +{ + static initializeHandles initializeCachedResponseHandles(TSHttpTxnCachedRespGet); + if (initializeCachedResponseHandles(state_->txn_, state_->cached_response_hdr_buf_, state_->cached_response_hdr_loc_, + "cached response")) { +LOG_DEBUG("Initializing cached response"); +state_->cached_response_.init(state_->cached_response_hdr_buf_, state_->cached_response_hdr_loc_); + } +} http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5fed400/lib/atscppapi/src/include/atscppapi/Transaction.h -- diff --git a/lib/atscppapi/src/include/atscppapi/Tran
trafficserver git commit: TS-4008: Cleanup SPDY ClientSessionSession / SpdyRequest Allocate and Deallocate code
Repository: trafficserver Updated Branches: refs/heads/master 343810126 -> 0d4c680e1 TS-4008: Cleanup SPDY ClientSessionSession / SpdyRequest Allocate and Deallocate code Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0d4c680e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0d4c680e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0d4c680e Branch: refs/heads/master Commit: 0d4c680e155dade5ac38fff6eeae1f01fd3e33bf Parents: 3438101 Author: Can Selcik Authored: Mon Nov 9 23:25:03 2015 -0800 Committer: Brian Geffon Committed: Mon Nov 9 23:25:03 2015 -0800 -- proxy/spdy/SpdyCallbacks.cc | 2 +- proxy/spdy/SpdyClientSession.cc | 17 +++-- proxy/spdy/SpdyClientSession.h | 23 +-- 3 files changed, 29 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0d4c680e/proxy/spdy/SpdyCallbacks.cc -- diff --git a/proxy/spdy/SpdyCallbacks.cc b/proxy/spdy/SpdyCallbacks.cc index 69b40c8..6b3c02b 100644 --- a/proxy/spdy/SpdyCallbacks.cc +++ b/proxy/spdy/SpdyCallbacks.cc @@ -309,7 +309,7 @@ spdy_on_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type type, sp switch (type) { case SPDYLAY_SYN_STREAM: stream_id = frame->syn_stream.stream_id; -req = spdyRequestAllocator.alloc(); +req = SpdyRequest::alloc(); req->init(sm, stream_id); req->append_nv(frame->syn_stream.nv); sm->req_map[stream_id] = req; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0d4c680e/proxy/spdy/SpdyClientSession.cc -- diff --git a/proxy/spdy/SpdyClientSession.cc b/proxy/spdy/SpdyClientSession.cc index c3d23b3..ae7c737 100644 --- a/proxy/spdy/SpdyClientSession.cc +++ b/proxy/spdy/SpdyClientSession.cc @@ -47,6 +47,20 @@ static int spdy_process_fetch_header(TSEvent event, SpdyClientSession *sm, TSFet static int spdy_process_fetch_body(TSEvent event, SpdyClientSession *sm, TSFetchSM fetch_sm, SpdyRequest *req); static uint64_t g_sm_id = 1; +SpdyRequest * +SpdyRequest::alloc() +{ + return spdyRequestAllocator.alloc(); +} + +void +SpdyRequest::destroy() +{ + this->clear(); + spdyRequestAllocator.free(this); +} + + void SpdyRequest::init(SpdyClientSession *sm, int id) { @@ -136,8 +150,7 @@ SpdyClientSession::clear() for (; iter != endIter; ++iter) { SpdyRequest *req = iter->second; if (req) { - req->clear(); - spdyRequestAllocator.free(req); + req->destroy(); } else { Error("req null in SpdSM::clear"); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0d4c680e/proxy/spdy/SpdyClientSession.h -- diff --git a/proxy/spdy/SpdyClientSession.h b/proxy/spdy/SpdyClientSession.h index 516a34c..5e5d183 100644 --- a/proxy/spdy/SpdyClientSession.h +++ b/proxy/spdy/SpdyClientSession.h @@ -38,23 +38,24 @@ class SpdyRequest { public: SpdyRequest() -: spdy_sm(NULL), stream_id(-1), fetch_sm(NULL), has_submitted_data(false), need_resume_data(false), fetch_data_len(0), - delta_window_size(0), fetch_body_completed(false) +: event(0), spdy_sm(NULL), stream_id(-1), start_time(0), fetch_sm(NULL), has_submitted_data(false), need_resume_data(false), + fetch_data_len(0), delta_window_size(0), fetch_body_completed(false) { } SpdyRequest(SpdyClientSession *sm, int id) -: spdy_sm(NULL), stream_id(-1), fetch_sm(NULL), has_submitted_data(false), need_resume_data(false), fetch_data_len(0), - delta_window_size(0), fetch_body_completed(false) +: event(0), spdy_sm(NULL), stream_id(-1), start_time(0), fetch_sm(NULL), has_submitted_data(false), need_resume_data(false), + fetch_data_len(0), delta_window_size(0), fetch_body_completed(false) { init(sm, id); } - ~SpdyRequest() { clear(); } - void init(SpdyClientSession *sm, int id); void clear(); + static SpdyRequest *alloc(); + void destroy(); + void append_nv(char **nv) { @@ -93,9 +94,12 @@ class SpdyClientSession : public ProxyClientSession, public PluginIdentity { public: typedef ProxyClientSession super; ///< Parent type. - SpdyClientSession() {} + SpdyClientSession() +: sm_id(0), version(spdy::SessionVersion::SESSION_VERSION_3_1), total_size(0), start_time(0), vc(NULL), req_buffer(NULL), + req_reader(NULL), resp_buffer(NULL), resp_reader(NULL), read_vio(NULL), write_vio(NULL), event(0), session(NULL) + { + } - ~SpdyClientSession() { clear(); } void init(NetVConnection *netvc); void clear(); @@ -178,8 +182,7 @@ public: { SpdyRequest *req = this->find_request(strea
trafficserver git commit: TS-4007: Clang format
Repository: trafficserver Updated Branches: refs/heads/master e4cb30531 -> 343810126 TS-4007: Clang format Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/34381012 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/34381012 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/34381012 Branch: refs/heads/master Commit: 343810126e1dcce967d37305813c913d85995aa3 Parents: e4cb305 Author: Brian Geffon Authored: Mon Nov 9 22:44:39 2015 -0800 Committer: Brian Geffon Committed: Mon Nov 9 22:44:39 2015 -0800 -- lib/ts/Allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/34381012/lib/ts/Allocator.h -- diff --git a/lib/ts/Allocator.h b/lib/ts/Allocator.h index a21ff90..518ccf6 100644 --- a/lib/ts/Allocator.h +++ b/lib/ts/Allocator.h @@ -194,7 +194,7 @@ public: */ ClassAllocator(const char *name, unsigned int chunk_size = 128, unsigned int alignment = 16) { -::new ((void*)&proto.typeObject) C(); +::new ((void *)&proto.typeObject) C(); ink_freelist_init(&this->fl, name, RND16(sizeof(C)), chunk_size, RND16(alignment)); }
trafficserver git commit: TS-4007: ClassAllocator: don't attempt to destruct the prototype object when ClassAllocator goes out of scope
Repository: trafficserver Updated Branches: refs/heads/master c7610467e -> e4cb30531 TS-4007: ClassAllocator: don't attempt to destruct the prototype object when ClassAllocator goes out of scope Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e4cb3053 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e4cb3053 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e4cb3053 Branch: refs/heads/master Commit: e4cb305315e4969748c9dc8414fd96c8d36b4091 Parents: c761046 Author: Can Selcik Authored: Mon Nov 9 22:29:37 2015 -0800 Committer: Brian Geffon Committed: Mon Nov 9 22:38:24 2015 -0800 -- lib/ts/Allocator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e4cb3053/lib/ts/Allocator.h -- diff --git a/lib/ts/Allocator.h b/lib/ts/Allocator.h index 3b489a7..a21ff90 100644 --- a/lib/ts/Allocator.h +++ b/lib/ts/Allocator.h @@ -40,6 +40,7 @@ #ifndef _Allocator_h_ #define _Allocator_h_ +#include #include #include "ts/ink_queue.h" #include "ts/ink_defs.h" @@ -193,11 +194,12 @@ public: */ ClassAllocator(const char *name, unsigned int chunk_size = 128, unsigned int alignment = 16) { +::new ((void*)&proto.typeObject) C(); ink_freelist_init(&this->fl, name, RND16(sizeof(C)), chunk_size, RND16(alignment)); } struct { -C typeObject; +uint8_t typeObject[sizeof(C)]; int64_t space_holder; } proto; };
trafficserver git commit: Resolve coverity #1325735, #1325734, #1325736
Repository: trafficserver Updated Branches: refs/heads/master 61cbc5b95 -> e71350b4b Resolve coverity #1325735, #1325734, #1325736 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e71350b4 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e71350b4 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e71350b4 Branch: refs/heads/master Commit: e71350b4b9c8abc3a81432c203accca03ed172e1 Parents: 61cbc5b Author: Brian Geffon Authored: Tue Oct 6 06:43:58 2015 -0700 Committer: Brian Geffon Committed: Tue Oct 6 06:49:31 2015 -0700 -- plugins/header_rewrite/header_rewrite_test.cc | 2 ++ plugins/header_rewrite/parser.cc | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e71350b4/plugins/header_rewrite/header_rewrite_test.cc -- diff --git a/plugins/header_rewrite/header_rewrite_test.cc b/plugins/header_rewrite/header_rewrite_test.cc index 4c836e4..ff78beb 100644 --- a/plugins/header_rewrite/header_rewrite_test.cc +++ b/plugins/header_rewrite/header_rewrite_test.cc @@ -37,6 +37,7 @@ TSError(const char *fmt, ...) if ((bytes = vsnprintf(buf, sizeof(buf), fmt, args)) > 0) { fprintf(stderr, "TSError: %s: %.*s\n", PLUGIN_NAME, bytes, buf); } + va_end(args); } extern "C" void @@ -49,6 +50,7 @@ TSDebug(const char *tag, const char *fmt, ...) if ((bytes = vsnprintf(buf, sizeof(buf), fmt, args)) > 0) { fprintf(stdout, "TSDebug: %s: %.*s\n", PLUGIN_NAME, bytes, buf); } + va_end(args); } #define CHECK_EQ(x, y) \ http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e71350b4/plugins/header_rewrite/parser.cc -- diff --git a/plugins/header_rewrite/parser.cc b/plugins/header_rewrite/parser.cc index 43ead4a..609b5be 100644 --- a/plugins/header_rewrite/parser.cc +++ b/plugins/header_rewrite/parser.cc @@ -69,9 +69,6 @@ Parser::Parser(const std::string &line) : _cond(false), _empty(false) return; } } else if (!extracting_token) { - if (inquote) -continue; /* just keep eating until we hit the closing quote */ - if (_tokens.empty() && line[i] == '#') { // this is a comment line (it may have had leading whitespace before the #) _empty = true;
trafficserver git commit: TS-3956: clang format (sorry zwoop ;/)
Repository: trafficserver Updated Branches: refs/heads/master 147b9668e -> 61cbc5b95 TS-3956: clang format (sorry zwoop ;/) Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/61cbc5b9 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/61cbc5b9 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/61cbc5b9 Branch: refs/heads/master Commit: 61cbc5b95a2d0ebbb1247d10628115112eac8827 Parents: 147b966 Author: Brian Geffon Authored: Tue Oct 6 00:24:52 2015 -0700 Committer: Brian Geffon Committed: Tue Oct 6 00:24:52 2015 -0700 -- plugins/header_rewrite/header_rewrite_test.cc | 59 +- plugins/header_rewrite/parser.cc | 9 ++-- 2 files changed, 38 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61cbc5b9/plugins/header_rewrite/header_rewrite_test.cc -- diff --git a/plugins/header_rewrite/header_rewrite_test.cc b/plugins/header_rewrite/header_rewrite_test.cc index f4fdabd..4c836e4 100644 --- a/plugins/header_rewrite/header_rewrite_test.cc +++ b/plugins/header_rewrite/header_rewrite_test.cc @@ -27,45 +27,53 @@ const char PLUGIN_NAME[] = "TEST_header_rewrite"; const char PLUGIN_NAME_DBG[] = "TEST_dbg_header_rewrite"; -extern "C" void TSError(const char* fmt, ...) { +extern "C" void +TSError(const char *fmt, ...) +{ char buf[2048]; int bytes = 0; va_list args; - va_start (args, fmt); - if((bytes = vsnprintf (buf, sizeof(buf), fmt, args)) > 0) { + va_start(args, fmt); + if ((bytes = vsnprintf(buf, sizeof(buf), fmt, args)) > 0) { fprintf(stderr, "TSError: %s: %.*s\n", PLUGIN_NAME, bytes, buf); } } -extern "C" void TSDebug(const char *tag, const char* fmt, ...) { +extern "C" void +TSDebug(const char *tag, const char *fmt, ...) +{ char buf[2048]; int bytes = 0; va_list args; - va_start (args, fmt); - if((bytes = vsnprintf (buf, sizeof(buf), fmt, args)) > 0) { + va_start(args, fmt); + if ((bytes = vsnprintf(buf, sizeof(buf), fmt, args)) > 0) { fprintf(stdout, "TSDebug: %s: %.*s\n", PLUGIN_NAME, bytes, buf); } } -#define CHECK_EQ(x, y) \ - do { \ - if ( (x) != (y) ) { \ -fprintf(stderr, "CHECK FAILED\n"); \ -return 1; \ - } \ +#define CHECK_EQ(x, y) \ + do { \ +if ((x) != (y)) {\ + fprintf(stderr, "CHECK FAILED\n"); \ + return 1; \ +}\ } while (false); -class ParserTest : public Parser { +class ParserTest : public Parser +{ public: - ParserTest(std::string line) : Parser(line) { } + ParserTest(std::string line) : Parser(line) {} - std::vector getTokens() { + std::vector + getTokens() + { return _tokens; } }; -int test_parsing() { - +int +test_parsing() +{ { ParserTest p("cond %{READ_REQUEST_HDR_HOOK}"); CHECK_EQ(p.getTokens().size(), 2); @@ -177,8 +185,9 @@ int test_parsing() { return 0; } -int test_processing() { - +int +test_processing() +{ /* * These tests are designed to verify that the processing of the parsed input is correct. */ @@ -210,16 +219,18 @@ int test_processing() { return 0; } -int tests() { - if (test_parsing() || - test_processing()) { +int +tests() +{ + if (test_parsing() || test_processing()) { return 1; } return 0; } -int main () { +int +main() +{ return tests(); } - http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61cbc5b9/plugins/header_rewrite/parser.cc -- diff --git a/plugins/header_rewrite/parser.cc b/plugins/header_rewrite/parser.cc index e7e32c3..43ead4a 100644 --- a/plugins/header_rewrite/parser.cc +++ b/plugins/header_rewrite/parser.cc @@ -36,9 +36,7 @@ Parser::Parser(const std::string &line) : _cond(false), _empty(false) off_t cur_token_start = 0; size_t cur_token_length = 0; for (size_t i = 0; i < line.size(); ++i) { - -if (!inquote && -(std::isspace(line[i]) || (line[i] == '=' || line[i] == '>' || line[i] == '<'))) { +if (!inquote && (std::isspace(line[i]) || (line[i] == '=' || line[i] == '>' || line[i] == '<'))) { if (extracting_token) { cur_token_length = i - cur_token_start; @@ -129,9 +127,8 @@ Parser::preprocess(std::vector tokens) std::string s = tokens[0].substr(2, tokens[0].size() - 3); _op = s; - if (tokens.size() > 2 - && (tokens[1][0] == '=' || tokens[1][0] == '>' || tokens[1][0] == '<')) { // cond + (=/) + argument - _arg = tokens[1] + tokens[2]; + if (tokens.size() > 2 && (tokens[1][0] == '=' || tokens[1][0] == '>' ||
trafficserver git commit: TS-3956: Header_rewrite applies strange logic with = operator, remove %{} which breaks printf
Repository: trafficserver Updated Branches: refs/heads/master 8c148c9e8 -> 147b9668e TS-3956: Header_rewrite applies strange logic with = operator, remove %{} which breaks printf Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/147b9668 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/147b9668 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/147b9668 Branch: refs/heads/master Commit: 147b9668eea55354b063ba6f77b48b34b65247c9 Parents: 8c148c9 Author: Brian Geffon Authored: Tue Oct 6 00:20:26 2015 -0700 Committer: Brian Geffon Committed: Tue Oct 6 00:20:26 2015 -0700 -- plugins/header_rewrite/header_rewrite_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/147b9668/plugins/header_rewrite/header_rewrite_test.cc -- diff --git a/plugins/header_rewrite/header_rewrite_test.cc b/plugins/header_rewrite/header_rewrite_test.cc index ebc9e2b..f4fdabd 100644 --- a/plugins/header_rewrite/header_rewrite_test.cc +++ b/plugins/header_rewrite/header_rewrite_test.cc @@ -50,7 +50,7 @@ extern "C" void TSDebug(const char *tag, const char* fmt, ...) { #define CHECK_EQ(x, y) \ do { \ if ( (x) != (y) ) { \ -fprintf(stderr, "CHECK FAILED " #x " != " #y "\n"); \ +fprintf(stderr, "CHECK FAILED\n"); \ return 1; \ } \ } while (false);
trafficserver git commit: TS-3956: Header_rewrite applies strange logic with = operator, this closes #300
Repository: trafficserver Updated Branches: refs/heads/master 370ad860d -> 8c148c9e8 TS-3956: Header_rewrite applies strange logic with = operator, this closes #300 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8c148c9e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8c148c9e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8c148c9e Branch: refs/heads/master Commit: 8c148c9e885ea28ead4d46f49350256602b84d82 Parents: 370ad86 Author: Brian Geffon Authored: Tue Oct 6 00:06:49 2015 -0700 Committer: Brian Geffon Committed: Tue Oct 6 00:15:20 2015 -0700 -- plugins/header_rewrite/Makefile.am| 6 +- plugins/header_rewrite/header_rewrite_test.cc | 225 + plugins/header_rewrite/parser.cc | 141 - plugins/header_rewrite/parser.h | 5 +- 4 files changed, 323 insertions(+), 54 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8c148c9e/plugins/header_rewrite/Makefile.am -- diff --git a/plugins/header_rewrite/Makefile.am b/plugins/header_rewrite/Makefile.am index 8a1abf6..5a7acd3 100644 --- a/plugins/header_rewrite/Makefile.am +++ b/plugins/header_rewrite/Makefile.am @@ -31,5 +31,9 @@ header_rewrite_la_SOURCES = \ resources.cc \ ruleset.cc \ statement.cc - + header_rewrite_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS) + +bin_PROGRAMS = header_rewrite_test +header_rewrite_test_SOURCES = parser.cc header_rewrite_test.cc +header_rewrite_test_CXXFLAGS = $(AM_CXXFLAGS) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8c148c9e/plugins/header_rewrite/header_rewrite_test.cc -- diff --git a/plugins/header_rewrite/header_rewrite_test.cc b/plugins/header_rewrite/header_rewrite_test.cc new file mode 100644 index 000..ebc9e2b --- /dev/null +++ b/plugins/header_rewrite/header_rewrite_test.cc @@ -0,0 +1,225 @@ +/* + 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. +*/ + +/* + * These are misc unit tests for header rewrite + */ + +#include +#include +#include + +const char PLUGIN_NAME[] = "TEST_header_rewrite"; +const char PLUGIN_NAME_DBG[] = "TEST_dbg_header_rewrite"; + +extern "C" void TSError(const char* fmt, ...) { + char buf[2048]; + int bytes = 0; + va_list args; + va_start (args, fmt); + if((bytes = vsnprintf (buf, sizeof(buf), fmt, args)) > 0) { +fprintf(stderr, "TSError: %s: %.*s\n", PLUGIN_NAME, bytes, buf); + } +} + +extern "C" void TSDebug(const char *tag, const char* fmt, ...) { + char buf[2048]; + int bytes = 0; + va_list args; + va_start (args, fmt); + if((bytes = vsnprintf (buf, sizeof(buf), fmt, args)) > 0) { +fprintf(stdout, "TSDebug: %s: %.*s\n", PLUGIN_NAME, bytes, buf); + } +} + +#define CHECK_EQ(x, y) \ + do { \ + if ( (x) != (y) ) { \ +fprintf(stderr, "CHECK FAILED " #x " != " #y "\n"); \ +return 1; \ + } \ + } while (false); + +class ParserTest : public Parser { +public: + ParserTest(std::string line) : Parser(line) { } + + std::vector getTokens() { +return _tokens; + } +}; + +int test_parsing() { + + { +ParserTest p("cond %{READ_REQUEST_HDR_HOOK}"); +CHECK_EQ(p.getTokens().size(), 2); +CHECK_EQ(p.getTokens()[0], "cond"); +CHECK_EQ(p.getTokens()[1], "%{READ_REQUEST_HDR_HOOK}"); + } + + { +ParserTest p("cond %{CLIENT-HEADER:Host}=a"); +CHECK_EQ(p.getTokens().size(), 4); +CHECK_EQ(p.getTokens()[0], "cond"); +CHECK_EQ(p.getTokens()[1], "%{CLIENT-HEADER:Host}"); +CHECK_EQ(p.getTokens()[2], "="); +CHECK_EQ(p.getTokens()[3], "a"); + } + + { +ParserTest p(" # COMMENT!"); +CHECK_EQ(p.getTokens().size(), 0); +CHECK_EQ(p.empty(), true); + } + + { +ParserTest p("# COMMENT"); +CHECK_EQ(p.getTokens().size(), 0); +CHECK_EQ(p.empty(), true); + } + + { +ParserTest p("cond %{Client-HEADER:Foo} =b"); +CHECK_EQ(p.getTokens().size(), 4); +CHECK_EQ(p.getTokens()
trafficserver git commit: TS-3942: Crash when enumerating HostDB records in HostDB UI
Repository: trafficserver Updated Branches: refs/heads/master f68e950f3 -> 89606cb54 TS-3942: Crash when enumerating HostDB records in HostDB UI Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/89606cb5 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/89606cb5 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/89606cb5 Branch: refs/heads/master Commit: 89606cb540b026cc238adf78f393221335d69599 Parents: f68e950 Author: Brian Geffon Authored: Thu Sep 24 00:49:30 2015 -0700 Committer: Brian Geffon Committed: Thu Sep 24 00:49:30 2015 -0700 -- iocore/hostdb/HostDB.cc | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/89606cb5/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 984d137..eb5b541 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1598,6 +1598,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e) item.md5_low = r->md5_low; item.md5_low_low = r->md5_low_low; item.full = 1; +item.hostname_offset = 0; item.app.allotment.application1 = 0; item.app.allotment.application2 = 0; @@ -1623,6 +1624,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e) for (ii = 0; ii < nn; ++ii) { if (is_addr_valid(af, e->ent.h_addr_list[ii])) { HostDBInfo &item = rr_data->info[i]; + memset(&item, 0, sizeof(item)); ip_addr_set(item.ip(), af, e->ent.h_addr_list[ii]); item.full = 1; item.round_robin = 0; @@ -1632,6 +1634,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e) item.md5_high = r->md5_high; item.md5_low = r->md5_low; item.md5_low_low = r->md5_low_low; + item.hostname_offset = 0; if (!restore_info(&item, old_r, old_info, old_rr_data)) { item.app.allotment.application1 = 0; item.app.allotment.application2 = 0;
trafficserver git commit: Adding testcase for min origin connections
Repository: trafficserver Updated Branches: refs/heads/master b405bb333 -> d2ba4f105 Adding testcase for min origin connections Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d2ba4f10 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d2ba4f10 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d2ba4f10 Branch: refs/heads/master Commit: d2ba4f1058f6b8ee0f310c74cfddf67fa8baa1f0 Parents: b405bb3 Author: Brian Geffon Authored: Wed Aug 12 00:25:43 2015 -0700 Committer: Brian Geffon Committed: Wed Aug 12 00:25:43 2015 -0700 -- .../test_origin_min_keep_alive_connection.py| 103 +++ 1 file changed, 103 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d2ba4f10/ci/tsqa/tests/test_origin_min_keep_alive_connection.py -- diff --git a/ci/tsqa/tests/test_origin_min_keep_alive_connection.py b/ci/tsqa/tests/test_origin_min_keep_alive_connection.py new file mode 100644 index 000..741cd56 --- /dev/null +++ b/ci/tsqa/tests/test_origin_min_keep_alive_connection.py @@ -0,0 +1,103 @@ +''' +Test the configure entry : proxy.config.http.origin_min_keep_alive_connections +''' + +# 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. + +import os +import requests +import time +import logging +import SocketServer +import uuid +import socket +import tsqa.test_cases +import helpers +import thread + +log = logging.getLogger(__name__) + +def simple_socket_server(host, port): +log.info("starting the socket server") +serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +serv.bind((host, port)) +serv.setblocking(1) +serv.listen(3) +conn_id = uuid.uuid4().hex +while True: +conn, addr = serv.accept() +data = conn.recv(4096).strip() +if data: +log.info('Sending data back to the client: {uid}'.format(uid=conn_id)) +else: +log.info('Client disconnected: {timeout}seconds'.format(timeout=now)) +break +body = conn_id +resp = ('HTTP/1.1 200 OK\r\n' +'Content-Length: {content_length}\r\n' +'Content-Type: text/html; charset=UTF-8\r\n' +'Connection: keep-alive\r\n' +'\r\n' +'{body}'.format(content_length=len(body), body=body)) +conn.sendall(resp) +serv.shutdown(socket.SHUT_RDWR) +serv.close() +log.info("end the socket server") + + +class TestKeepAlive_Origin_Min_connections(helpers.EnvironmentCase): +@classmethod +def setUpEnv(cls, env): +cls.traffic_server_host = '127.0.0.1' +cls.traffic_server_port = int(cls.configs['records.config']['CONFIG']['proxy.config.http.server_ports']) +cls.socket_server_port = int(tsqa.utils.bind_unused_port()[1]) +log.info("socket_server_port = %d" % (cls.socket_server_port)) +thread.start_new_thread(simple_socket_server, (cls.traffic_server_host, cls.socket_server_port, )) +cls.configs['remap.config'].add_line('map / http://127.0.0.1:{0}'.format(cls.socket_server_port)) +cls.origin_keep_alive_timeout = 3 + cls.configs['records.config']['CONFIG']['origin_min_keep_alive_connections'] = 1 +cls.configs['records.config']['CONFIG']['keep_alive_enabled_out'] = 1 + cls.configs['records.config']['CONFIG']['proxy.config.http.keep_alive_no_activity_timeout_out'] = cls.origin_keep_alive_timeout + +def test_origin_min_connection(self): +conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +conn.connect((self.traffic_server_host, self.traffic_server_port)) +request_content = 'GET / HTTP/1.1\r\nConnection: keep-alive\r\nHost: 127.0.0.1\r\n\r\n' +conn.setblocking(1) +conn.send(request_content) +first_resp = None +second_resp = None +while 1: +try: +resp = conn.recv(4096) +resp = resp.split('\r\n\r
[2/2] trafficserver git commit: TS-3792: Pointing proxy.config.dns.resolv_conf at an empty (or nonexistant) file causes crashes. Prevent ATS from crashing.
TS-3792: Pointing proxy.config.dns.resolv_conf at an empty (or nonexistant) file causes crashes. Prevent ATS from crashing. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/cc623317 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/cc623317 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/cc623317 Branch: refs/heads/master Commit: cc6233173338d6304b89b959d35a6eda01f98e7c Parents: 576c2de Author: Zizhong Zhang Authored: Tue Jul 28 22:21:30 2015 -0700 Committer: Brian Geffon Committed: Mon Aug 10 19:40:19 2015 -0700 -- iocore/dns/DNS.cc | 7 +++ lib/ts/ink_res_init.cc | 15 +++ 2 files changed, 10 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cc623317/iocore/dns/DNS.cc -- diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc index 4601147..1cb5698 100644 --- a/iocore/dns/DNS.cc +++ b/iocore/dns/DNS.cc @@ -883,6 +883,13 @@ write_dns(DNSHandler *h) int max_nscount = h->m_res->nscount; if (max_nscount > MAX_NAMED) max_nscount = MAX_NAMED; + if (max_nscount <= 0) { +Warning("There is no name server found in the resolv.conf"); +if (h->entries.head) { + dns_result(h, h->entries.head, NULL, false); +} +return; + } if (h->in_write_dns) return; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cc623317/lib/ts/ink_res_init.cc -- diff --git a/lib/ts/ink_res_init.cc b/lib/ts/ink_res_init.cc index 00dc938..958f2dd 100644 --- a/lib/ts/ink_res_init.cc +++ b/lib/ts/ink_res_init.cc @@ -432,7 +432,7 @@ ink_res_init(ink_res_state statp, ///< State object to update. #define MATCH(line, name) \ (!strncmp(line, name, sizeof(name) - 1) && (line[sizeof(name) - 1] == ' ' || line[sizeof(name) - 1] == '\t')) -retry_load_resolve_conf: + if ((fp = fopen(pResolvConf, "r")) != NULL) { /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { @@ -521,17 +521,8 @@ retry_load_resolve_conf: (void)fclose(fp); } - if (nserv == 0 && strcmp(pResolvConf, "/etc/resolv.conf") != 0) { -syslog(LOG_WARNING, "WARNING: trying default because user specified did not have any resolvers"); -pResolvConf = "/etc/resolv.conf"; -goto retry_load_resolve_conf; - } - if (nserv == 0) { -syslog(LOG_ERR, "ERR: aborting the traffic server because it did not have any resolvers"); -abort(); - } - - statp->nscount = nserv; + if (nserv > 0) +statp->nscount = nserv; if (statp->defdname[0] == 0 && gethostname(buf, sizeof(statp->defdname) - 1) == 0 && (cp = strchr(buf, '.')) != NULL) ink_strlcpy(statp->defdname, cp + 1, sizeof(statp->defdname));
[1/2] trafficserver git commit: TS-3792: Pointing proxy.config.dns.resolv_conf at an empty (or nonexistant) file causes crashes.
Repository: trafficserver Updated Branches: refs/heads/master b597f9cfa -> cc6233173 TS-3792: Pointing proxy.config.dns.resolv_conf at an empty (or nonexistant) file causes crashes. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/576c2de9 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/576c2de9 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/576c2de9 Branch: refs/heads/master Commit: 576c2de9d2e17f6930e718ec34f8fb3baba692d1 Parents: b597f9c Author: Zizhong Zhang Authored: Sun Jul 26 21:46:52 2015 -0700 Committer: Brian Geffon Committed: Mon Aug 10 19:40:18 2015 -0700 -- lib/ts/ink_res_init.cc | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/576c2de9/lib/ts/ink_res_init.cc -- diff --git a/lib/ts/ink_res_init.cc b/lib/ts/ink_res_init.cc index 958f2dd..00dc938 100644 --- a/lib/ts/ink_res_init.cc +++ b/lib/ts/ink_res_init.cc @@ -432,7 +432,7 @@ ink_res_init(ink_res_state statp, ///< State object to update. #define MATCH(line, name) \ (!strncmp(line, name, sizeof(name) - 1) && (line[sizeof(name) - 1] == ' ' || line[sizeof(name) - 1] == '\t')) - +retry_load_resolve_conf: if ((fp = fopen(pResolvConf, "r")) != NULL) { /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { @@ -521,8 +521,17 @@ ink_res_init(ink_res_state statp, ///< State object to update. (void)fclose(fp); } - if (nserv > 0) -statp->nscount = nserv; + if (nserv == 0 && strcmp(pResolvConf, "/etc/resolv.conf") != 0) { +syslog(LOG_WARNING, "WARNING: trying default because user specified did not have any resolvers"); +pResolvConf = "/etc/resolv.conf"; +goto retry_load_resolve_conf; + } + if (nserv == 0) { +syslog(LOG_ERR, "ERR: aborting the traffic server because it did not have any resolvers"); +abort(); + } + + statp->nscount = nserv; if (statp->defdname[0] == 0 && gethostname(buf, sizeof(statp->defdname) - 1) == 0 && (cp = strchr(buf, '.')) != NULL) ink_strlcpy(statp->defdname, cp + 1, sizeof(statp->defdname));
trafficserver git commit: TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked
Repository: trafficserver Updated Branches: refs/heads/6.0.x fdceeb5f6 -> 8f89e542c TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8f89e542 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8f89e542 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8f89e542 Branch: refs/heads/6.0.x Commit: 8f89e542cd7e3927153b01b792d5e56e2b282029 Parents: fdceeb5 Author: Zizhong Zhang Authored: Thu Aug 6 01:49:50 2015 -0700 Committer: Brian Geffon Committed: Thu Aug 6 18:49:03 2015 -0700 -- proxy/http/HttpTransact.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8f89e542/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 3fb42fa..a4d492e 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -7928,8 +7928,12 @@ HttpTransact::build_response(State *s, HTTPHdr *base_response, HTTPHdr *outgoing // If the response is prohibited from containing a body, // we know the content length is trustable for keep-alive - if (is_response_body_precluded(status_code, s->method)) + if (is_response_body_precluded(status_code, s->method)) { s->hdr_info.trust_response_cl = true; +s->hdr_info.response_content_length = 0; +s->client_info.transfer_encoding = HttpTransact::NO_TRANSFER_ENCODING; +s->server_info.transfer_encoding = HttpTransact::NO_TRANSFER_ENCODING; + } handle_response_keep_alive_headers(s, outgoing_version, outgoing_response);
[1/4] trafficserver git commit: TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked
Repository: trafficserver Updated Branches: refs/heads/master 1bf8746e0 -> 2f154297a TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/aa9b94fa Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/aa9b94fa Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/aa9b94fa Branch: refs/heads/master Commit: aa9b94fab4020798b81a749f6e5994387f7a09c9 Parents: 5597664 Author: Zizhong Zhang Authored: Thu Aug 6 01:49:50 2015 -0700 Committer: Zizhong Zhang Committed: Thu Aug 6 01:49:50 2015 -0700 -- proxy/http/HttpTransact.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aa9b94fa/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 3fb42fa..a4d492e 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -7928,8 +7928,12 @@ HttpTransact::build_response(State *s, HTTPHdr *base_response, HTTPHdr *outgoing // If the response is prohibited from containing a body, // we know the content length is trustable for keep-alive - if (is_response_body_precluded(status_code, s->method)) + if (is_response_body_precluded(status_code, s->method)) { s->hdr_info.trust_response_cl = true; +s->hdr_info.response_content_length = 0; +s->client_info.transfer_encoding = HttpTransact::NO_TRANSFER_ENCODING; +s->server_info.transfer_encoding = HttpTransact::NO_TRANSFER_ENCODING; + } handle_response_keep_alive_headers(s, outgoing_version, outgoing_response);
[3/4] trafficserver git commit: TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked. ADD TESTS. ensure the Content-Length is passed over.
TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked. ADD TESTS. ensure the Content-Length is passed over. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a0f8567a Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a0f8567a Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a0f8567a Branch: refs/heads/master Commit: a0f8567a2ad75b8c25781e9e20cdcfb208b1fe6b Parents: d7fa8cc Author: Zizhong Zhang Authored: Thu Aug 6 17:28:38 2015 -0700 Committer: Zizhong Zhang Committed: Thu Aug 6 17:28:38 2015 -0700 -- ci/tsqa/tests/test_headrequest.py | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a0f8567a/ci/tsqa/tests/test_headrequest.py -- diff --git a/ci/tsqa/tests/test_headrequest.py b/ci/tsqa/tests/test_headrequest.py index 1e75edc..a636db8 100644 --- a/ci/tsqa/tests/test_headrequest.py +++ b/ci/tsqa/tests/test_headrequest.py @@ -107,6 +107,7 @@ class TestHeadRequestWithoutTimeout(helpers.EnvironmentCase): resp = conn.recv(4096) if len(resp) == 0: break +response_content = resp log.info(resp) except: break @@ -116,3 +117,5 @@ class TestHeadRequestWithoutTimeout(helpers.EnvironmentCase): log.info("head request with case(%s) costs %f seconds while the timout is %f seconds." % ( request_case, end_time - begin_time, cls.timeout)) cls.assertGreater(cls.timeout, end_time - begin_time) +if request_case == 'CL': +cls.assertIn('Content-Length', response_content)
[4/4] trafficserver git commit: Merge branch 'TS-3828' of https://github.com/zizhong/trafficserver
Merge branch 'TS-3828' of https://github.com/zizhong/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2f154297 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2f154297 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2f154297 Branch: refs/heads/master Commit: 2f154297a749bc9da54ce4373ef7198dcd75fb02 Parents: 1bf8746 a0f8567 Author: Brian Geffon Authored: Thu Aug 6 18:46:47 2015 -0700 Committer: Brian Geffon Committed: Thu Aug 6 18:46:47 2015 -0700 -- ci/tsqa/tests/test_headrequest.py | 121 + proxy/http/HttpTransact.cc| 6 +- 2 files changed, 126 insertions(+), 1 deletion(-) --
[2/4] trafficserver git commit: TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked. ADD TESTS
TS-3828: HEAD requests hang when origin returns Transfer-Encoding: Chunked. ADD TESTS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d7fa8ccd Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d7fa8ccd Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d7fa8ccd Branch: refs/heads/master Commit: d7fa8ccdde14b205ebb6ce423df7313e69574794 Parents: aa9b94f Author: Zizhong Zhang Authored: Thu Aug 6 01:51:54 2015 -0700 Committer: Zizhong Zhang Committed: Thu Aug 6 01:51:54 2015 -0700 -- ci/tsqa/tests/test_headrequest.py | 118 + 1 file changed, 118 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d7fa8ccd/ci/tsqa/tests/test_headrequest.py -- diff --git a/ci/tsqa/tests/test_headrequest.py b/ci/tsqa/tests/test_headrequest.py new file mode 100644 index 000..1e75edc --- /dev/null +++ b/ci/tsqa/tests/test_headrequest.py @@ -0,0 +1,118 @@ +''' +Test Head Request +''' + +# 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. + +import os +import requests +import time +import logging +import SocketServer +import random +import tsqa.test_cases +import helpers +import json +import select +import socket + +log = logging.getLogger(__name__) + + +class HeadRequestServerHandler(SocketServer.BaseRequestHandler): +""" +A subclass of RequestHandler which will response to head requests +""" + +def handle(self): +# Receive the data in small chunks and retransmit it +while True: +data = self.request.recv(4096).strip() +if data: +log.debug('Sending data back to the client') +else: +log.debug('Client disconnected') +break +if 'TE' in data: +resp = ('HTTP/1.1 200 OK\r\n' +'Server: Apache-Coyote/1.1\r\n' +'Transfer-Encoding: chunked\r\n' +'Vary: Accept-Encoding\r\n' +'\r\n' +) +self.request.sendall(resp) +elif 'CL' in data: +resp = ('HTTP/1.1 200 OK\r\n' +'Server: Apache-Coyote/1.1\r\n' +'Content-Length: 123\r\n' +'Vary: Accept-Encoding\r\n' +'\r\n' +) +self.request.sendall(resp) +else: +resp = ('HTTP/1.1 200 OK\r\n' +'Server: Apache-Coyote/1.1\r\n' +'Vary: Accept-Encoding\r\n' +'\r\n' +) +self.request.sendall(resp) + + + +class TestHeadRequestWithoutTimeout(helpers.EnvironmentCase): +''' +Tests for ATS handling head requests correctly without waiting for the http body +''' +@classmethod +def setUpEnv(cls, env): +cls.timeout = 5 +cls.configs['records.config']['CONFIG'].update({ +'proxy.config.http.transaction_no_activity_timeout_out': cls.timeout, +}) +cls.socket_server = tsqa.endpoint.SocketServerDaemon(HeadRequestServerHandler) +cls.socket_server.start() +cls.socket_server.ready.wait() +cls.configs['remap.config'].add_line('map / http://127.0.0.1:{0}/'.format(cls.socket_server.port)) +log.info('map / http://127.0.0.1:{0}/'.format(cls.socket_server.port)) + +cls.proxy_host = '127.0.0.1' +cls.proxy_port = int(cls.configs['records.config']['CONFIG']['proxy.config.http.server_ports']) + +def test_head_request_without_timout(cls): +request_cases = ['TE', 'CL', ''] +for request_case in request_cases: +begin_time = time.time() +conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +conn.connect((cls.proxy_host, cls.proxy_port)) +request_content = 'HEAD / HTTP/1.1\r\nConnection: close\r\nHost: 127.0.0.1\r\nC
trafficserver git commit: TS-3776: traffic_server failed assert s->current.server->had_connect_fail()
Repository: trafficserver Updated Branches: refs/heads/master 2ce049b03 -> 679006e2e TS-3776: traffic_server failed assert s->current.server->had_connect_fail() Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/679006e2 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/679006e2 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/679006e2 Branch: refs/heads/master Commit: 679006e2e0de239d081268bc61f430f343271516 Parents: 2ce049b Author: Brian Geffon Authored: Mon Aug 3 20:23:03 2015 -0700 Committer: Brian Geffon Committed: Mon Aug 3 20:23:03 2015 -0700 -- proxy/http/HttpTransact.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/679006e2/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index b63f8bc..ff82c09 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -3658,7 +3658,8 @@ HttpTransact::handle_response_from_server(State *s) DebugTxn("http_trans", "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying..."); SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE); -handle_server_connection_not_open(s); +handle_server_died(s); +s->next_action = SM_ACTION_SEND_ERROR_CACHE_NOOP; break; } case OPEN_RAW_ERROR:
trafficserver git commit: TS-3376: traffic_server failed assert s->current.server->had_connect_fail()
Repository: trafficserver Updated Branches: refs/heads/master a532d6d9d -> 619b0390f TS-3376: traffic_server failed assert s->current.server->had_connect_fail() Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/619b0390 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/619b0390 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/619b0390 Branch: refs/heads/master Commit: 619b0390f711e77b39b82e8791655f7597abbca3 Parents: a532d6d Author: Brian Geffon Authored: Sun Aug 2 20:35:30 2015 -0700 Committer: Brian Geffon Committed: Sun Aug 2 20:35:30 2015 -0700 -- proxy/http/HttpTransact.cc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/619b0390/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index b63f8bc..48cf2a0 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -3651,6 +3651,11 @@ HttpTransact::handle_response_from_server(State *s) break; case CONNECTION_CLOSED: /* fall through */ +DebugTxn("http_trans", + "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying..."); + SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE); + handle_server_connection_not_open(s); + break; case PARSE_ERROR: /* fall through */ case BAD_INCOMING_RESPONSE: { @@ -3658,7 +3663,8 @@ HttpTransact::handle_response_from_server(State *s) DebugTxn("http_trans", "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying..."); SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE); -handle_server_connection_not_open(s); +handle_server_died(s); +s->next_action = SM_ACTION_SEND_ERROR_CACHE_NOOP; break; } case OPEN_RAW_ERROR:
trafficserver git commit: TS-3800: Fix bug in hostdb ui related to missing query
Repository: trafficserver Updated Branches: refs/heads/master 0cd1ef3ed -> fc133036c TS-3800: Fix bug in hostdb ui related to missing query Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fc133036 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fc133036 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fc133036 Branch: refs/heads/master Commit: fc133036c2e4a6cd8d95c9432cd62e703a3303b1 Parents: 0cd1ef3 Author: Brian Geffon Authored: Tue Jul 28 20:20:57 2015 -0700 Committer: Brian Geffon Committed: Tue Jul 28 20:20:57 2015 -0700 -- iocore/hostdb/HostDB.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fc133036/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 0d36fd6..984d137 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -2672,7 +2672,7 @@ register_ShowHostDB(Continuation *c, HTTPHdr *h) } else if (STR_LEN_EQ_PREFIX(path, path_len, "showall")) { int query_len = 0; const char *query = h->url_get()->query_get(&query_len); -if (strstr(query, "json")) { +if (query && query_len && strstr(query, "json")) { s->output_json = true; } Debug("hostdb", "dumping all hostdb records");
trafficserver git commit: TS-3803: CID 1313322 CID 1313322: HostDB memory issues (introduced in TS-3800)
Repository: trafficserver Updated Branches: refs/heads/master ec7479243 -> 0cd1ef3ed TS-3803: CID 1313322 CID 1313322: HostDB memory issues (introduced in TS-3800) Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0cd1ef3e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0cd1ef3e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0cd1ef3e Branch: refs/heads/master Commit: 0cd1ef3ed5e4e6e3a332bccdd07220be717f2226 Parents: ec74792 Author: Brian Geffon Authored: Tue Jul 28 19:43:35 2015 -0700 Committer: Brian Geffon Committed: Tue Jul 28 19:43:35 2015 -0700 -- iocore/hostdb/HostDB.cc | 16 1 file changed, 12 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0cd1ef3e/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 5a9c85a..0d36fd6 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1365,10 +1365,18 @@ HostDBContinuation::lookup_done(IpAddr const &ip, char const *aname, bool around } } - const size_t s_size = strlen(aname) + 1; - void *host_dest = hostDB.alloc(&i->hostname_offset, s_size); - ink_strlcpy((char *)host_dest, aname, s_size); - *((char *)host_dest + s_size) = '\0'; + if (aname) { +const size_t s_size = strlen(aname) + 1; +void *host_dest = hostDB.alloc(&i->hostname_offset, s_size); +if (host_dest) { + ink_strlcpy((char *)host_dest, aname, s_size); + *((char *)host_dest + s_size) = '\0'; +} else { + Warning("Out of room in hostdb for hostname (data area full!)"); + hostDB.delete_block(i); + return NULL; +} + } if (from_cont) do_put_response(from, i, from_cont);
trafficserver git commit: TS-3800: HostDB UI: support json output, improve srv records, add hostnames
Repository: trafficserver Updated Branches: refs/heads/master 95f45d4a7 -> 0e703e1e3 TS-3800: HostDB UI: support json output, improve srv records, add hostnames Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0e703e1e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0e703e1e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0e703e1e Branch: refs/heads/master Commit: 0e703e1e3b7198f5c4b0648971fd35d56421e4fd Parents: 95f45d4 Author: Brian Geffon Authored: Mon Jul 27 22:14:09 2015 -0700 Committer: Brian Geffon Committed: Mon Jul 27 22:14:09 2015 -0700 -- iocore/hostdb/HostDB.cc | 169 ++--- iocore/hostdb/I_HostDBProcessor.h | 3 + proxy/Show.h | 16 +++- 3 files changed, 153 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0e703e1e/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 9d5ece3..5a9c85a 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1364,6 +1364,12 @@ HostDBContinuation::lookup_done(IpAddr const &ip, char const *aname, bool around } } } + + const size_t s_size = strlen(aname) + 1; + void *host_dest = hostDB.alloc(&i->hostname_offset, s_size); + ink_strlcpy((char *)host_dest, aname, s_size); + *((char *)host_dest + s_size) = '\0'; + if (from_cont) do_put_response(from, i, from_cont); ink_assert(!i->round_robin || !i->reverse_dns); @@ -2311,6 +2317,17 @@ HostDBInfo::hostname() return (char *)hostDB.ptr(&data.hostname_offset, hostDB.ptr_to_partition((char *)this)); } +/* + * The perm_hostname exists for all records not just reverse dns records. + */ +char * +HostDBInfo::perm_hostname() +{ + if (hostname_offset == 0) +return NULL; + + return (char *)hostDB.ptr(&hostname_offset, hostDB.ptr_to_partition((char *)this)); +} HostDBRoundRobin * HostDBInfo::rr() @@ -2373,6 +2390,8 @@ struct ShowHostDB : public ShowCont { uint16_t port; IpEndpoint ip; bool force; + bool output_json; + int records_seen; int showMain(int event, Event *e) @@ -2412,8 +2431,12 @@ struct ShowHostDB : public ShowCont { int showAll(int event, Event *e) { -CHECK_SHOW(begin("HostDB All Records")); -CHECK_SHOW(show("")); +if (!output_json) { + CHECK_SHOW(begin("HostDB All Records")); + CHECK_SHOW(show("")); +} else { + CHECK_SHOW(show("[")); +} SET_HANDLER(&ShowHostDB::showAllEvent); hostDBProcessor.iterate(this); return EVENT_CONT; @@ -2424,22 +2447,54 @@ struct ShowHostDB : public ShowCont { { if (event == EVENT_INTERVAL) { HostDBInfo *r = reinterpret_cast(e); + if (output_json && records_seen++ > 0) { +CHECK_SHOW(show(",")); // we need to seperate records + } showOne(r, false, event, e); if (r->round_robin) { HostDBRoundRobin *rr_data = r->rr(); if (rr_data) { - CHECK_SHOW(show("\n")); - CHECK_SHOW(show("%s%d\n", "Total", rr_data->rrcount)); - CHECK_SHOW(show("%s%d\n", "Good", rr_data->good)); - CHECK_SHOW(show("%s%d\n", "Current", rr_data->current)); - CHECK_SHOW(show("\n")); + if (!output_json) { +CHECK_SHOW(show("\n")); +CHECK_SHOW(show("%s%d\n", "Total", rr_data->rrcount)); +CHECK_SHOW(show("%s%d\n", "Good", rr_data->good)); +CHECK_SHOW(show("%s%d\n", "Current", rr_data->current)); +CHECK_SHOW(show("\n")); + } else { +CHECK_SHOW(show(",\"%s\":\"%d\",", "rr_total", rr_data->rrcount)); +CHECK_SHOW(show("\"%s\":\"%d\",", "rr_good", rr_data->good)); +CHECK_SHOW(show("\"%s\":\"%d\",", "rr_current", rr_data->current)); +CHECK_SHOW(show("\"rr_records\":[")); + } - for (int i = 0; i < rr_data->rrcount; i++) -showOne(&rr_data->info[i], true, event, e); + for (int i = 0; i < rr_data->rrcount; i++) { +showOne(&rr_data->info[i], true, event, e, rr_data); +if (output_json) { + CHECK_SHOW(show("}")); // we need to seperate records + if (i < (rr_data->rrcount - 1)) +CHECK_SHOW(show(",")); +} + } + + if (!output_json) { +CHECK_SHOW(show("\n\n")); + } else { +CHECK_SHOW(show("]")); + } } } + + if (output_json) { +CHECK_SHOW(show("}")); + } + } else if (event == EVENT_DONE) { - return complete(event, e); + if (output_json) { +CHECK_SHOW(show("]")); +
[1/2] trafficserver git commit: TS-3781: Add the log field "pqsp" (server port)
Repository: trafficserver Updated Branches: refs/heads/master a90403e9f -> aa59a0d52 TS-3781: Add the log field "pqsp" (server port) We already have the server IP available as a field for logging. This patch adds the server port as well. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/44da2647 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/44da2647 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/44da2647 Branch: refs/heads/master Commit: 44da26474dece5868f5d49316286ffd3fb2bbe34 Parents: bb6f9f3 Author: Jonh Wendell Authored: Mon Jul 20 19:41:59 2015 -0300 Committer: Jonh Wendell Committed: Mon Jul 20 19:41:59 2015 -0300 -- proxy/logging/Log.cc | 5 + proxy/logging/LogAccess.cc | 9 + proxy/logging/LogAccess.h | 1 + proxy/logging/LogAccessHttp.cc | 10 ++ proxy/logging/LogAccessHttp.h | 1 + 5 files changed, 26 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/44da2647/proxy/logging/Log.cc -- diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc index 01921f4..617c16c 100644 --- a/proxy/logging/Log.cc +++ b/proxy/logging/Log.cc @@ -587,6 +587,11 @@ Log::init_fields() global_field_list.add(field, false); ink_hash_table_insert(field_symbol_hash, "pqsi", field); + field = new LogField("proxy_req_server_port", "pqsp", LogField::sINT, &LogAccess::marshal_proxy_req_server_port, + &LogAccess::unmarshal_int_to_str); + global_field_list.add(field, false); + ink_hash_table_insert(field_symbol_hash, "pqsp", field); + Ptr hierarchy_map = make_ptr(new LogFieldAliasTable); hierarchy_map->init( 36, SQUID_HIER_EMPTY, "EMPTY", SQUID_HIER_NONE, "NONE", SQUID_HIER_DIRECT, "DIRECT", SQUID_HIER_SIBLING_HIT, "SIBLING_HIT", http://git-wip-us.apache.org/repos/asf/trafficserver/blob/44da2647/proxy/logging/LogAccess.cc -- diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc index bea3b1b..9e57dca 100644 --- a/proxy/logging/LogAccess.cc +++ b/proxy/logging/LogAccess.cc @@ -389,6 +389,15 @@ LogAccess::marshal_proxy_req_server_ip(char *buf) -*/ int +LogAccess::marshal_proxy_req_server_port(char *buf) +{ + DEFAULT_INT_FIELD; +} + +/*- + -*/ + +int LogAccess::marshal_proxy_hierarchy_route(char *buf) { DEFAULT_INT_FIELD; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/44da2647/proxy/logging/LogAccess.h -- diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h index 143aedf..15c5181 100644 --- a/proxy/logging/LogAccess.h +++ b/proxy/logging/LogAccess.h @@ -213,6 +213,7 @@ public: inkcoreapi virtual int marshal_proxy_req_body_len(char *);// INT inkcoreapi virtual int marshal_proxy_req_server_name(char *); // STR inkcoreapi virtual int marshal_proxy_req_server_ip(char *); // INT + inkcoreapi virtual int marshal_proxy_req_server_port(char *); // INT inkcoreapi virtual int marshal_proxy_hierarchy_route(char *); // INT inkcoreapi virtual int marshal_proxy_host_name(char *); // STR inkcoreapi virtual int marshal_proxy_host_ip(char *); // STR http://git-wip-us.apache.org/repos/asf/trafficserver/blob/44da2647/proxy/logging/LogAccessHttp.cc -- diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc index 8d457ab..40779f4 100644 --- a/proxy/logging/LogAccessHttp.cc +++ b/proxy/logging/LogAccessHttp.cc @@ -906,6 +906,16 @@ LogAccessHttp::marshal_proxy_req_server_ip(char *buf) return marshal_ip(buf, m_http_sm->t_state.current.server != NULL ? &m_http_sm->t_state.current.server->dst_addr.sa : 0); } +int +LogAccessHttp::marshal_proxy_req_server_port(char *buf) +{ + if (buf) { + uint16_t port = ntohs(m_http_sm->t_state.current.server != NULL ? m_http_sm->t_state.current.server->dst_addr.port() : 0); + marshal_int(buf, port); + } + return INK_MIN_ALIGN; +} + /*- -*/ http://git-wip-us.apache.org/repos/asf/trafficserver/blob/44da2647/proxy/logging/LogAccessHttp.h -- diff --git a/proxy/logging/LogAccessHttp.h b/proxy/logging/LogAccessHttp.h index 9847
[2/2] trafficserver git commit: Merge branch 'log-pqsp' of https://github.com/jwendell/trafficserver
Merge branch 'log-pqsp' of https://github.com/jwendell/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/aa59a0d5 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/aa59a0d5 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/aa59a0d5 Branch: refs/heads/master Commit: aa59a0d5274f54bff23b8af83a6fe020b39cf3df Parents: a90403e 44da264 Author: Brian Geffon Authored: Sun Jul 26 20:31:23 2015 -0700 Committer: Brian Geffon Committed: Sun Jul 26 20:31:23 2015 -0700 -- proxy/logging/Log.cc | 5 + proxy/logging/LogAccess.cc | 9 + proxy/logging/LogAccess.h | 1 + proxy/logging/LogAccessHttp.cc | 10 ++ proxy/logging/LogAccessHttp.h | 1 + 5 files changed, 26 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aa59a0d5/proxy/logging/Log.cc -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aa59a0d5/proxy/logging/LogAccess.cc -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aa59a0d5/proxy/logging/LogAccess.h -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aa59a0d5/proxy/logging/LogAccessHttp.cc -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/aa59a0d5/proxy/logging/LogAccessHttp.h --
[2/2] trafficserver git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d3a7f1b2 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d3a7f1b2 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d3a7f1b2 Branch: refs/heads/master Commit: d3a7f1b2f847feee3c17f1eaaa91df50ffef5e25 Parents: 08b5af2 392d3ab Author: Brian Geffon Authored: Thu Jul 23 00:02:43 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 23 00:02:43 2015 -0700 -- proxy/hdrs/HdrHeap.cc | 2 +- proxy/hdrs/MIME.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --
[1/2] trafficserver git commit: TS-3773: HostDB view all: add more detail for RR records
Repository: trafficserver Updated Branches: refs/heads/master 392d3abc9 -> d3a7f1b2f TS-3773: HostDB view all: add more detail for RR records Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/08b5af2f Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/08b5af2f Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/08b5af2f Branch: refs/heads/master Commit: 08b5af2f89f4b05bca7a0b59076eae1c8894e163 Parents: f5e521e Author: Brian Geffon Authored: Thu Jul 23 00:02:27 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 23 00:02:27 2015 -0700 -- iocore/hostdb/HostDB.cc | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08b5af2f/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 99a8480..0c91ea3 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -2430,7 +2430,20 @@ struct ShowHostDB : public ShowCont { { if (event == EVENT_INTERVAL) { HostDBInfo *r = reinterpret_cast(e); - return showOne(r, false, event, e); + showOne(r,false,event,e); + if (r->round_robin) { + HostDBRoundRobin *rr_data = r->rr(); + if (rr_data) { +CHECK_SHOW(show("\n")); +CHECK_SHOW(show("%s%d\n", "Total", rr_data->rrcount)); +CHECK_SHOW(show("%s%d\n", "Good", rr_data->good)); +CHECK_SHOW(show("%s%d\n", "Current", rr_data->current)); +CHECK_SHOW(show("\n")); + +for (int i = 0; i < rr_data->rrcount; i++) + showOne(&rr_data->info[i], true, event, e); + } + } } else if (event == EVENT_DONE) { return complete(event, e); } else {
[4/4] trafficserver git commit: Merge branch 'bodyFactory' of https://github.com/zizhong/trafficserver
Merge branch 'bodyFactory' of https://github.com/zizhong/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f5e521e6 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f5e521e6 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f5e521e6 Branch: refs/heads/master Commit: f5e521e630515c7d745e12bc5b71fa049a21f2a7 Parents: b2b0040 ee92ad2 Author: Brian Geffon Authored: Wed Jul 22 21:09:11 2015 -0700 Committer: Brian Geffon Committed: Wed Jul 22 21:09:11 2015 -0700 -- ci/tsqa/tests/test_body_factory.py | 79 .../configuration/records.config.en.rst | 1 + proxy/http/HttpBodyFactory.cc | 22 +- proxy/http/HttpBodyFactory.h| 1 + 4 files changed, 102 insertions(+), 1 deletion(-) --
[1/4] trafficserver git commit: TS-3779: Body Factory: support per host error pages
Repository: trafficserver Updated Branches: refs/heads/master b2b004066 -> f5e521e63 TS-3779: Body Factory: support per host error pages Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/09beb115 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/09beb115 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/09beb115 Branch: refs/heads/master Commit: 09beb115c52802bab2967bde2ac9c7cdc14fd68d Parents: bb6f9f3 Author: Zizhong Zhang Authored: Mon Jul 20 22:28:32 2015 -0700 Committer: Zizhong Zhang Committed: Mon Jul 20 22:28:32 2015 -0700 -- proxy/http/HttpBodyFactory.cc | 22 +- proxy/http/HttpBodyFactory.h | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09beb115/proxy/http/HttpBodyFactory.cc -- diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc index 51a3e8f..89960b2 100644 --- a/proxy/http/HttpBodyFactory.cc +++ b/proxy/http/HttpBodyFactory.cc @@ -419,10 +419,13 @@ HttpBodyFactory::fabricate(StrList *acpt_language_list, StrList *acpt_charset_li Debug("body_factory", " customization disabled, returning NULL template"); return (NULL); } + // what set should we use (language target if enable_customizations == 2) if (enable_customizations == 2) set = determine_set_by_language(acpt_language_list, acpt_charset_list); - else + else if (enable_customizations == 3) { +set = determine_set_by_host(context); + } else set = "default"; if (set_return) @@ -446,6 +449,23 @@ HttpBodyFactory::fabricate(StrList *acpt_language_list, StrList *acpt_charset_li // LOCKING: must be called with lock taken const char * +HttpBodyFactory::determine_set_by_host(HttpTransact::State *context) { + const char *set; + RawHashTable_Value v; + int host_len = context->hh_info.host_len; + char host_buffer[host_len + 1]; + strncpy(host_buffer, context->hh_info.request_host, host_len); + host_buffer[host_len] = '\0'; + if (table_of_sets->getValue((RawHashTable_Key)host_buffer, &v)) { +set = table_of_sets->getKeyFromBinding(table_of_sets->getCurrentBinding((RawHashTable_Key)host_buffer)); + } else { +set = "default"; + } + return set; +} + +// LOCKING: must be called with lock taken +const char * HttpBodyFactory::determine_set_by_language(StrList *acpt_language_list, StrList *acpt_charset_list) { float Q_best; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09beb115/proxy/http/HttpBodyFactory.h -- diff --git a/proxy/http/HttpBodyFactory.h b/proxy/http/HttpBodyFactory.h index 110b0df..f5c4086 100644 --- a/proxy/http/HttpBodyFactory.h +++ b/proxy/http/HttpBodyFactory.h @@ -187,6 +187,7 @@ private: const char **set_return = NULL); const char *determine_set_by_language(StrList *acpt_language_list, StrList *acpt_charset_list); + const char *determine_set_by_host(HttpTransact::State *context); HttpBodyTemplate *find_template(const char *set, const char *type, HttpBodySet **body_set_return); bool is_response_suppressed(HttpTransact::State *context); bool
[2/4] trafficserver git commit: TS-3779: Body Factory: support per host error pages: TESTS
TS-3779: Body Factory: support per host error pages: TESTS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1ee3c26c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1ee3c26c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1ee3c26c Branch: refs/heads/master Commit: 1ee3c26c19c3952c6249e0ce57e57c444cd07064 Parents: 09beb11 Author: Zizhong Zhang Authored: Mon Jul 20 22:34:44 2015 -0700 Committer: Zizhong Zhang Committed: Mon Jul 20 22:34:44 2015 -0700 -- ci/tsqa/tests/test_body_factory.py | 79 + 1 file changed, 79 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ee3c26c/ci/tsqa/tests/test_body_factory.py -- diff --git a/ci/tsqa/tests/test_body_factory.py b/ci/tsqa/tests/test_body_factory.py new file mode 100644 index 000..fd8f8b5 --- /dev/null +++ b/ci/tsqa/tests/test_body_factory.py @@ -0,0 +1,79 @@ +''' +Test body_factory +''' + +# 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. + +import os +import requests +import time +import logging +import SocketServer +import random +import tsqa.test_cases +import helpers +import json + +log = logging.getLogger(__name__) + +class TestDomainSpecificBodyFactory(helpers.EnvironmentCase): +''' +Tests for how body factory works with requests of different domains +''' +@classmethod +def setUpEnv(cls, env): +cls.configs['records.config']['CONFIG'].update({ +'proxy.config.body_factory.enable_customizations': 3, # enable domain specific body factory +}) +cls.configs['remap.config'].add_line( +'map / http://www.linkedin.com/ @action=deny' +) +cls.body_factory_dir = os.path.join(cls.environment.layout.prefix, cls.configs['records.config']['CONFIG']['proxy.config.body_factory.template_sets_dir']) +cls.domain_directory = ['www.linkedin.com', '127.0.0.1', 'www.foobar.net'] +for directory_item in cls.domain_directory: +current_dir = os.path.join(cls.body_factory_dir, directory_item) +try: +os.mkdir(current_dir) +except: +pass +fname = os.path.join(current_dir, "access#denied") +with open(fname, "w") as f: + f.write(directory_item) +fname = os.path.join(current_dir, ".body_factory_info") +with open(fname, "w") as f: + pass + +def test_domain_specific_body_factory(self): + times = 1000 + no_dir_domain = 'www.nodir.com' + self.domain_directory.append(no_dir_domain) + self.assertEqual(4, len(self.domain_directory)) + url = 'http://127.1.0.1:{0}'.format(self.configs['records.config']['CONFIG']['proxy.config.http.server_ports']) + for i in xrange(times): + domain = random.choice(self.domain_directory) + headers = {'Host' : domain} + r = requests.get(url, headers = headers) + domain_in_response = no_dir_domain + for domain_item in self.domain_directory: + if domain_item in r.text: + domain_in_response = domain_item + break + self.assertEqual(domain, domain_in_response) + + + +
[3/4] trafficserver git commit: TS-3779: Body Factory: support per host error pages: DOCUMENTATION
TS-3779: Body Factory: support per host error pages: DOCUMENTATION Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ee92ad2d Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ee92ad2d Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ee92ad2d Branch: refs/heads/master Commit: ee92ad2ddb90570a7f2f94bc7f11afed6904268a Parents: 1ee3c26 Author: Zizhong Zhang Authored: Mon Jul 20 22:37:31 2015 -0700 Committer: Zizhong Zhang Committed: Mon Jul 20 22:37:31 2015 -0700 -- doc/reference/configuration/records.config.en.rst | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ee92ad2d/doc/reference/configuration/records.config.en.rst -- diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst index 8ada5e1..0b0a150 100644 --- a/doc/reference/configuration/records.config.en.rst +++ b/doc/reference/configuration/records.config.en.rst @@ -1690,6 +1690,7 @@ Customizable User Response Pages - ``1`` = enable customizable user response pages in the default directory only - ``2`` = enable language-targeted user response pages + - ``3`` = enable host-targeted user response pages .. ts:cv:: CONFIG proxy.config.body_factory.enable_logging INT 0
[4/5] trafficserver git commit: Merge branch 'customLog' of https://github.com/zizhong/trafficserver
Merge branch 'customLog' of https://github.com/zizhong/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/aa8170a4 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/aa8170a4 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/aa8170a4 Branch: refs/heads/master Commit: aa8170a4615fa1a721bd4295a3be1b6cb52a488d Parents: db4029a 727f6ca Author: Brian Geffon Authored: Wed Jul 22 21:00:30 2015 -0700 Committer: Brian Geffon Committed: Wed Jul 22 21:00:30 2015 -0700 -- ci/tsqa/tests/test_custom_log.py | 71 + doc/admin/event-logging-formats.en.rst | 10 proxy/logging/Log.cc | 11 + proxy/logging/LogAccess.cc | 5 ++ proxy/logging/LogAccess.h | 9 ++-- proxy/logging/LogAccessHttp.cc | 6 +++ proxy/logging/LogAccessHttp.h | 1 + 7 files changed, 109 insertions(+), 4 deletions(-) --
[1/5] trafficserver git commit: TS-3780: Logs_xml: add logging field for incoming (interface) ip.
Repository: trafficserver Updated Branches: refs/heads/master 404e7866b -> b2b004066 TS-3780: Logs_xml: add logging field for incoming (interface) ip. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/063cb576 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/063cb576 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/063cb576 Branch: refs/heads/master Commit: 063cb576a753d75dc43f55b0a8438b59e90cc08b Parents: bb6f9f3 Author: Zizhong Zhang Authored: Mon Jul 20 22:41:08 2015 -0700 Committer: Zizhong Zhang Committed: Mon Jul 20 22:41:08 2015 -0700 -- proxy/logging/Log.cc | 11 +++ proxy/logging/LogAccess.cc | 5 + proxy/logging/LogAccess.h | 9 + proxy/logging/LogAccessHttp.cc | 6 ++ proxy/logging/LogAccessHttp.h | 1 + 5 files changed, 28 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/063cb576/proxy/logging/Log.cc -- diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc index 01921f4..6f20b46 100644 --- a/proxy/logging/Log.cc +++ b/proxy/logging/Log.cc @@ -344,7 +344,18 @@ Log::init_fields() new LogField("client_host_ip_hex", "chih", LogField::IP, &LogAccess::marshal_client_host_ip, &LogAccess::unmarshal_ip_to_hex); global_field_list.add(field, false); ink_hash_table_insert(field_symbol_hash, "chih", field); + + // interface ip + field = new LogField("host_interface_ip", "hii", LogField::IP, &LogAccess::marshal_host_interface_ip, &LogAccess::unmarshal_ip_to_str); + global_field_list.add(field, false); + ink_hash_table_insert(field_symbol_hash, "hii", field); + + field = +new LogField("host_interface_ip_hex", "hiih", LogField::IP, &LogAccess::marshal_host_interface_ip, &LogAccess::unmarshal_ip_to_hex); + global_field_list.add(field, false); + ink_hash_table_insert(field_symbol_hash, "hiih", field); + // interface ip end field = new LogField("client_auth_user_name", "caun", LogField::STRING, &LogAccess::marshal_client_auth_user_name, (LogField::UnmarshalFunc) & LogAccess::unmarshal_str); global_field_list.add(field, false); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/063cb576/proxy/logging/LogAccess.cc -- diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc index bea3b1b..012ec2a 100644 --- a/proxy/logging/LogAccess.cc +++ b/proxy/logging/LogAccess.cc @@ -92,6 +92,11 @@ LogAccess::marshal_client_host_ip(char *buf) DEFAULT_IP_FIELD; } +int +LogAccess::marshal_host_interface_ip(char *buf) +{ + DEFAULT_IP_FIELD; +} /*- -*/ int http://git-wip-us.apache.org/repos/asf/trafficserver/blob/063cb576/proxy/logging/LogAccess.h -- diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h index 143aedf..61f6679 100644 --- a/proxy/logging/LogAccess.h +++ b/proxy/logging/LogAccess.h @@ -170,10 +170,11 @@ public: // // client -> proxy fields // - inkcoreapi virtual int marshal_client_host_ip(char *);// STR - inkcoreapi virtual int marshal_client_host_port(char *); // INT - inkcoreapi virtual int marshal_client_auth_user_name(char *); // STR - int marshal_client_req_timestamp_sec(char *); // INT + inkcoreapi virtual int marshal_client_host_ip(char *);// STR + inkcoreapi virtual int marshal_host_interface_ip(char *); // STR + inkcoreapi virtual int marshal_client_host_port(char *); // INT + inkcoreapi virtual int marshal_client_auth_user_name(char *); // STR + int marshal_client_req_timestamp_sec(char *); // INT inkcoreapi virtual int marshal_client_req_text(char *); // STR inkcoreapi virtual int marshal_client_req_http_method(char *);// STR http://git-wip-us.apache.org/repos/asf/trafficserver/blob/063cb576/proxy/logging/LogAccessHttp.cc -- diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc index 8d457ab..4eedaa5 100644 --- a/proxy/logging/LogAccessHttp.cc +++ b/proxy/logging/LogAccessHttp.cc @@ -237,6 +237,12 @@ LogAccessHttp::marshal_client_host_ip(char *buf) return marshal_ip(buf, &m_http_sm->t_state.client_info.src_addr.sa); } +int +LogAccessHttp::marshal_host_interface_ip(char *buf) +{ + return marshal_ip(buf, &m_http_sm->t_state.client_info.dst_addr.sa); +} + /*
[2/5] trafficserver git commit: TS-3780: Logs_xml: add logging field for incoming (interface) ip. TESTS
TS-3780: Logs_xml: add logging field for incoming (interface) ip. TESTS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e3997919 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e3997919 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e3997919 Branch: refs/heads/master Commit: e39979197066c4e32cfee8dd6ca9301d4fbc02b3 Parents: 063cb57 Author: Zizhong Zhang Authored: Mon Jul 20 22:45:16 2015 -0700 Committer: Zizhong Zhang Committed: Mon Jul 20 22:45:16 2015 -0700 -- ci/tsqa/tests/test_custom_log.py | 71 +++ 1 file changed, 71 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e3997919/ci/tsqa/tests/test_custom_log.py -- diff --git a/ci/tsqa/tests/test_custom_log.py b/ci/tsqa/tests/test_custom_log.py new file mode 100644 index 000..37573b7 --- /dev/null +++ b/ci/tsqa/tests/test_custom_log.py @@ -0,0 +1,71 @@ +''' +Test custom log field +''' + +# 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. + +import os +import requests +import time +import logging +import SocketServer +import random +import tsqa.test_cases +import helpers +import json + +log = logging.getLogger(__name__) + +class TestCustomLogField(helpers.EnvironmentCase): +''' +Tests for a customed log field called hii +''' +@classmethod +def setUpEnv(cls, env): + +cls.configs['remap.config'].add_line( +'map / http://www.linkedin.com/ @action=deny' +) +cls.log_file_name = 'test_log_field' +cls.configs['records.config']['CONFIG'].update({ + 'proxy.config.log.custom_logs_enabled': 1, +}) + +cls.log_file_path = os.path.join(cls.environment.layout.prefix, 'var/log/test_log_field.log') +cls.log_etc_file = os.path.join(cls.environment.layout.prefix, 'etc/trafficserver/logs_xml.config') +cls.configs['logs_xml.config'].add_line(' %"/>') +cls.configs['logs_xml.config'].add_line('') + +def ip_to_hex(self, ipstr): + num_list = ipstr.split('.') + int_value = (int(num_list[0]) << 24) + (int(num_list[1]) << 16) + (int(num_list[2]) << 8) + (int(num_list[3])) + return hex(int_value).upper()[2:] + +def test_log_field(self): + random.seed() + times = 10 + for i in xrange(times): +request_ip = "127.%d.%d.%d" % (random.randint(1, 255), random.randint(1, 255), random.randint(1, 255)) +url = 'http://%s:%s' % (request_ip, self.configs['records.config']['CONFIG']['proxy.config.http.server_ports']) +r = requests.get(url) +#get the last line of the log file +time.sleep(10) +with open(self.log_file_path) as f: + for line in f: +pass +expected_line = "%s %s\n" % (request_ip, self.ip_to_hex(request_ip)) +self.assertEqual(line, expected_line)
[5/5] trafficserver git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b2b00406 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b2b00406 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b2b00406 Branch: refs/heads/master Commit: b2b0040669818a3dc51b71617507b37e5d51d5c8 Parents: aa8170a 404e786 Author: Brian Geffon Authored: Wed Jul 22 21:01:19 2015 -0700 Committer: Brian Geffon Committed: Wed Jul 22 21:01:19 2015 -0700 -- iocore/cache/CacheDisk.cc |1 + iocore/net/SSLNetVConnection.cc | 103 +- lib/raft/raft_impl.h| 1028 +- lib/raft/test_makefile | 17 + .../ssl_cert_loader/ssl-cert-loader.cc |8 +- proxy/http2/test_Huffmancode.cc | 23 + proxy/spdy/SpdyClientSession.cc |2 +- 7 files changed, 610 insertions(+), 572 deletions(-) --
[3/5] trafficserver git commit: TS-3780: Logs_xml: add logging field for incoming (interface) ip. DOCUMENTATION
TS-3780: Logs_xml: add logging field for incoming (interface) ip. DOCUMENTATION Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/727f6caa Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/727f6caa Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/727f6caa Branch: refs/heads/master Commit: 727f6caafb7d492e13c8d6360b958c67256a9dca Parents: e399791 Author: Zizhong Zhang Authored: Mon Jul 20 22:56:11 2015 -0700 Committer: Zizhong Zhang Committed: Mon Jul 20 22:56:11 2015 -0700 -- doc/admin/event-logging-formats.en.rst | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/727f6caa/doc/admin/event-logging-formats.en.rst -- diff --git a/doc/admin/event-logging-formats.en.rst b/doc/admin/event-logging-formats.en.rst index cdd7923..b390965 100644 --- a/doc/admin/event-logging-formats.en.rst +++ b/doc/admin/event-logging-formats.en.rst @@ -109,6 +109,16 @@ The following list describes Traffic Server custom logging fields. ``chih`` The IP address of the client's host machine in hexadecimal. +.. _hii: + +``hii`` +This is the incoming (interface) ip for traffic server, in otherwords this is the ip address the client connected to. + +.. _hiih: + +``hiih`` +The the incoming (interface) ip in hexadecimal. + .. _chp: ``chp``
[2/2] trafficserver git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6c2c3128 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6c2c3128 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6c2c3128 Branch: refs/heads/master Commit: 6c2c31285cff51a405d2f3533780460b62fa06d5 Parents: 4933bad bcec70d Author: Brian Geffon Authored: Thu Jul 16 19:20:59 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 16 19:20:59 2015 -0700 -- build/plugins.mk| 1 - ci/jenkins/bin/in_tree.sh | 3 +- ci/jenkins/bin/out_of_tree.sh | 6 +- cmd/traffic_cop/Makefile.am | 2 - cmd/traffic_cop/traffic_cop.cc | 14 ++- cmd/traffic_crashlog/Makefile.am| 2 - cmd/traffic_crashlog/traffic_crashlog.cc| 9 +- cmd/traffic_crashlog/traffic_crashlog.h | 5 +- cmd/traffic_ctl/Makefile.am | 2 - cmd/traffic_ctl/traffic_ctl.h | 9 +- cmd/traffic_layout/Makefile.am | 2 - cmd/traffic_layout/traffic_layout.cc| 9 +- cmd/traffic_line/Makefile.am| 2 - cmd/traffic_line/traffic_line.cc| 12 +- cmd/traffic_manager/AddConfigFilesHere.cc | 4 +- cmd/traffic_manager/Makefile.am | 5 +- cmd/traffic_manager/MgmtHandlers.cc | 5 +- cmd/traffic_manager/StatProcessor.cc| 3 +- cmd/traffic_manager/StatProcessor.h | 4 +- cmd/traffic_manager/StatType.cc | 6 +- cmd/traffic_manager/StatXML.cc | 2 +- cmd/traffic_manager/StatXML.h | 2 +- cmd/traffic_manager/WebOverview.cc | 6 +- cmd/traffic_manager/WebOverview.h | 8 +- cmd/traffic_manager/traffic_manager.cc | 12 +- cmd/traffic_top/Makefile.am | 2 - cmd/traffic_top/traffic_top.cc | 2 +- cmd/traffic_via/Makefile.am | 2 - cmd/traffic_via/traffic_via.cc | 13 +-- cmd/traffic_wccp/Makefile.am| 1 - cmd/traffic_wccp/wccp_client.cc | 4 +- example/session-1/session-1.c | 2 +- example/version/version.c | 3 +- iocore/aio/I_AIO.h | 2 +- iocore/aio/Makefile.am | 4 +- iocore/aio/test_AIO.cc | 2 +- iocore/cache/Cache.cc | 4 +- iocore/cache/CacheDir.cc| 4 +- iocore/cache/CacheHosting.cc| 4 +- iocore/cache/CacheHttp.cc | 2 +- iocore/cache/I_Cache.h | 2 +- iocore/cache/I_CacheDefs.h | 2 + iocore/cache/I_Store.h | 2 +- iocore/cache/Makefile.am| 2 - iocore/cache/P_Cache.h | 4 +- iocore/cache/P_CacheInternal.h | 3 +- iocore/cache/RamCacheCLFUS.cc | 1 + iocore/cache/Store.cc | 7 +- iocore/cluster/ClusterMachine.cc| 5 +- iocore/cluster/Makefile.am | 2 - iocore/cluster/P_Cluster.h | 2 +- iocore/dns/Makefile.am | 2 - iocore/dns/P_DNS.h | 2 +- iocore/dns/P_DNSProcessor.h | 1 - iocore/dns/SRV.h| 2 +- iocore/dns/SplitDNS.cc | 7 +- iocore/eventsystem/IOBuffer.cc | 2 +- iocore/eventsystem/I_Action.h | 2 +- iocore/eventsystem/I_Continuation.h | 3 +- iocore/eventsystem/I_EThread.h | 4 +- iocore/eventsystem/I_Event.h| 2 +- iocore/eventsystem/I_EventProcessor.h | 2 +- iocore/eventsystem/I_EventSystem.h | 2 +- iocore/eventsystem/I_IOBuffer.h | 8 +- iocore/eventsystem/I_Lock.h | 3 +- iocore/eventsystem/I_PriorityEventQueue.h | 2 +- iocore/eventsystem/I_Processor.h| 2 +- iocore/eventsystem/I_ProtectedQueue.h | 2 +- iocore/eventsystem/I_ProxyAllocator.h | 2 +- iocore/eventsystem/I_SocketManager.h| 2 +- iocore/eventsystem/I_Thread.h | 3 +- iocore/eventsystem/I_VConnection.h | 2 +- iocore/eventsystem/I_VIO.h | 4 +- iocore/eventsystem/Lock.cc | 2 +- iocore/eventsystem/Makefile.am
[1/2] trafficserver git commit: TS-3773: HostDB UI: add endpoint to list all records
Repository: trafficserver Updated Branches: refs/heads/master bcec70dc8 -> 6c2c31285 TS-3773: HostDB UI: add endpoint to list all records Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4933bad8 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4933bad8 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4933bad8 Branch: refs/heads/master Commit: 4933bad8f9b119fb6774ce2c402c1e1ccbdcab51 Parents: 5a5311b Author: Brian Geffon Authored: Thu Jul 16 19:20:39 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 16 19:20:39 2015 -0700 -- iocore/hostdb/HostDB.cc | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4933bad8/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index df302d7..aed3896 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -2444,6 +2444,9 @@ struct ShowHostDB : public ShowCont { CHECK_SHOW(show("\n")); CHECK_SHOW(show("%s%s%s\n", "Type", r->round_robin ? "Round-Robin" : "", r->reverse_dns ? "Reverse DNS" : "DNS")); + +// Let's display the MD5. +CHECK_SHOW(show("%s%0.16llx %0.8x %0.8x\n", "MD5 (high, low, low low)", r->md5_high, r->md5_low, r->md5_low_low)); CHECK_SHOW(show("%s%u\n", "App1", r->app.allotment.application1)); CHECK_SHOW(show("%s%u\n", "App2", r->app.allotment.application2)); CHECK_SHOW(show("%s%u\n", "LastFailure", r->app.http_data.last_failure));
trafficserver git commit: HostDB HTTP UI: Fix merge issue. This closes #240
Repository: trafficserver Updated Branches: refs/heads/master 3c2f63faf -> 5a5311bca HostDB HTTP UI: Fix merge issue. This closes #240 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5a5311bc Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5a5311bc Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5a5311bc Branch: refs/heads/master Commit: 5a5311bca4f9acaab2a2a286fe635047bf5ae746 Parents: 3c2f63f Author: Brian Geffon Authored: Wed Jul 15 00:33:06 2015 -0700 Committer: Brian Geffon Committed: Wed Jul 15 00:33:06 2015 -0700 -- iocore/hostdb/HostDB.cc | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5a5311bc/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 0919b00..df302d7 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -2425,7 +2425,6 @@ struct ShowHostDB : public ShowCont { int showAllEvent(int event, Event *e) { -HostDBInfo *r = (HostDBInfo *)e; if (event == EVENT_INTERVAL) { HostDBInfo *r = reinterpret_cast(e); return showOne(r,false,event,e);
trafficserver git commit: HostDB HTTP UI: Fix merge issue. This closes #240
Repository: trafficserver Updated Branches: refs/heads/master 94f4083d0 -> 3c2f63faf HostDB HTTP UI: Fix merge issue. This closes #240 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3c2f63fa Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3c2f63fa Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3c2f63fa Branch: refs/heads/master Commit: 3c2f63faf03b7a2ddd7a73542944e9c21caf2227 Parents: 94f4083 Author: Brian Geffon Authored: Wed Jul 15 00:29:55 2015 -0700 Committer: Brian Geffon Committed: Wed Jul 15 00:29:55 2015 -0700 -- iocore/hostdb/HostDB.cc | 86 -- iocore/hostdb/I_HostDBProcessor.h | 2 +- iocore/hostdb/P_HostDBProcessor.h | 3 +- 3 files changed, 3 insertions(+), 88 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3c2f63fa/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 6abb7b0..0919b00 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1039,15 +1039,6 @@ HostDBProcessor::getbyname_imm(Continuation *cont, process_hostdb_info_pfn proce } Action * -HostDBProcessor::getall(Continuation *cont) -{ - ink_assert(cont->mutex->thread_holding == this_ethread()); - EThread *thread = cont->mutex->thread_holding; - ProxyMutex *mutex = thread->mutex; - - HOSTDB_INCREMENT_DYN_STAT(hostdb_total_lookups_stat); - -Action * HostDBProcessor::iterate(Continuation *cont) { ink_assert(cont->mutex->thread_holding == this_ethread()); @@ -1076,24 +1067,6 @@ HostDBProcessor::iterate(Continuation *cont) return &c->action; } - HostDBContinuation *c = hostDBContAllocator.alloc(); - HostDBContinuation::Options copt; - copt.cont = cont; - copt.force_dns = false; - copt.timeout = 0; - copt.host_res_style = HOST_RES_NONE; - c->init(HostDBMD5(), copt); - SET_CONTINUATION_HANDLER(c, (HostDBContHandler)&HostDBContinuation::probeAllEvent); - - if (thread->mutex == cont->mutex) { -thread->schedule_in(c, HOST_DB_RETRY_PERIOD); - } else { -dnsProcessor.thread->schedule_imm(c); - } - - return &c->action; -} - static void do_setby(HostDBInfo *r, HostDBApplicationInfo *app, const char *hostname, IpAddr const &ip, bool is_srv = false) { @@ -1916,40 +1889,6 @@ HostDBContinuation::do_put_response(ClusterMachine *m, HostDBInfo *r, Continuati clusterProcessor.invoke_remote(m->pop_ClusterHandler(), PUT_HOSTINFO_CLUSTER_FUNCTION, (char *)&msg, len); } -int -HostDBContinuation::probeAllEvent(int event, Event *e) -{ - Debug("hostdb", "probeAllEvent event=%d eventp=%p", event, e); - ink_assert(!link.prev && !link.next); - EThread *t = e ? e->ethread : this_ethread(); - - MUTEX_TRY_LOCK_FOR(lock, action.mutex, t, action.continuation); - if (!lock.is_locked()) { -mutex->thread_holding->schedule_in(this, HOST_DB_RETRY_PERIOD); -return EVENT_CONT; - } - - if (action.cancelled) { -hostdb_cont_free(this); -return EVENT_DONE; - } - - for (int i = 0; i < hostDB.buckets; ++i) { - ProxyMutex *bucket_mutex = hostDB.lock_for_bucket(i); - SCOPED_MUTEX_LOCK(lock, bucket_mutex, t); - for (unsigned int l = 0; l < hostDB.levels; ++l) { - HostDBInfo *r = reinterpret_cast(hostDB.data + hostDB.level_offset[l] + hostDB.bucketsize[l] * i); - if (!r->deleted && !r->failed()) { - action.continuation->handleEvent(EVENT_INTERVAL, static_cast(r)); - } - } - } - - action.continuation->handleEvent(EVENT_DONE, NULL); - hostdb_cont_free(this); - return EVENT_DONE; -} - // // Probe state // @@ -2479,31 +2418,6 @@ struct ShowHostDB : public ShowCont { CHECK_SHOW(begin("HostDB All Records")); CHECK_SHOW(show("")); SET_HANDLER(&ShowHostDB::showAllEvent); -hostDBProcessor.getall(this); -return EVENT_CONT; - } - - int - showAllEvent(int event, Event *e) - { -HostDBInfo *r = (HostDBInfo *)e; -if (event == EVENT_INTERVAL) { - HostDBInfo *r = reinterpret_cast(e); - return showOne(r,false,event,e); -} else if (event == EVENT_DONE) { - return complete(event, e); -} else { - ink_assert(!"unexpected event"); -} -return EVENT_CONT; - } - - int - showAll(int event , Event *e) - { -CHECK_SHOW(begin("HostDB All Records")); -CHECK_SHOW(show("")); -SET_HANDLER(&ShowHostDB::showAllEvent); hostDBProcessor.iterate(this); return EVENT_CONT; } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3c2f63fa/iocore/hostdb/I_HostDBProcessor.h -- diff --git a/iocore/hostdb/I_HostDBProcessor.h b/iocore/hostdb/I_HostDBProcessor.h index 37719f6..f5acf
trafficserver git commit: HostDB HTTP UI: Add a listall endpoint. This closes #240
Repository: trafficserver Updated Branches: refs/heads/master 44c90698a -> 94f4083d0 HostDB HTTP UI: Add a listall endpoint. This closes #240 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/94f4083d Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/94f4083d Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/94f4083d Branch: refs/heads/master Commit: 94f4083d02c545275177718a9a6c239de78ce978 Parents: 44c9069 Author: Brian Geffon Authored: Wed Jul 8 19:48:45 2015 -0700 Committer: Brian Geffon Committed: Tue Jul 14 22:45:39 2015 -0700 -- iocore/hostdb/HostDB.cc | 196 + iocore/hostdb/I_HostDBProcessor.h | 2 + iocore/hostdb/P_HostDBProcessor.h | 4 +- 3 files changed, 201 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/94f4083d/iocore/hostdb/HostDB.cc -- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 9ccd08a..6abb7b0 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1038,6 +1038,61 @@ HostDBProcessor::getbyname_imm(Continuation *cont, process_hostdb_info_pfn proce return &c->action; } +Action * +HostDBProcessor::getall(Continuation *cont) +{ + ink_assert(cont->mutex->thread_holding == this_ethread()); + EThread *thread = cont->mutex->thread_holding; + ProxyMutex *mutex = thread->mutex; + + HOSTDB_INCREMENT_DYN_STAT(hostdb_total_lookups_stat); + +Action * +HostDBProcessor::iterate(Continuation *cont) +{ + ink_assert(cont->mutex->thread_holding == this_ethread()); + EThread *thread = cont->mutex->thread_holding; + ProxyMutex *mutex = thread->mutex; + + HOSTDB_INCREMENT_DYN_STAT(hostdb_total_lookups_stat); + + + HostDBContinuation *c = hostDBContAllocator.alloc(); + HostDBContinuation::Options copt; + copt.cont = cont; + copt.force_dns = false; + copt.timeout = 0; + copt.host_res_style = HOST_RES_NONE; + c->init(HostDBMD5(), copt); + c->current_iterate_pos = 0; + SET_CONTINUATION_HANDLER(c, (HostDBContHandler)&HostDBContinuation::iterateEvent); + + if (thread->mutex == cont->mutex) { +thread->schedule_in(c, HOST_DB_RETRY_PERIOD); + } else { +dnsProcessor.thread->schedule_imm(c); + } + + return &c->action; +} + + HostDBContinuation *c = hostDBContAllocator.alloc(); + HostDBContinuation::Options copt; + copt.cont = cont; + copt.force_dns = false; + copt.timeout = 0; + copt.host_res_style = HOST_RES_NONE; + c->init(HostDBMD5(), copt); + SET_CONTINUATION_HANDLER(c, (HostDBContHandler)&HostDBContinuation::probeAllEvent); + + if (thread->mutex == cont->mutex) { +thread->schedule_in(c, HOST_DB_RETRY_PERIOD); + } else { +dnsProcessor.thread->schedule_imm(c); + } + + return &c->action; +} static void do_setby(HostDBInfo *r, HostDBApplicationInfo *app, const char *hostname, IpAddr const &ip, bool is_srv = false) @@ -1789,6 +1844,60 @@ HostDBContinuation::make_put_message(HostDBInfo *r, Continuation *c, char *buf, return len; } +int +HostDBContinuation::iterateEvent(int event, Event *e) +{ + Debug("hostdb", "iterateEvent event=%d eventp=%p", event, e); + ink_assert(!link.prev && !link.next); + EThread *t = e ? e->ethread : this_ethread(); + + MUTEX_TRY_LOCK_FOR(lock, action.mutex, t, action.continuation); + if (!lock.is_locked()) { +Debug("hostdb", "iterateEvent event=%d eventp=%p: reschedule due to not getting action mutex", event, e); +mutex->thread_holding->schedule_in(this, HOST_DB_RETRY_PERIOD); +return EVENT_CONT; + } + + if (action.cancelled) { +hostdb_cont_free(this); +return EVENT_DONE; + } + + // let's iterate through another record and then reschedule ourself. + if (current_iterate_pos < hostDB.buckets) { + // do 100 at a time + int end = min(current_iterate_pos + 100, hostDB.buckets); + for (; current_iterate_pos < end; ++current_iterate_pos) { + ProxyMutex *bucket_mutex = hostDB.lock_for_bucket(current_iterate_pos); + MUTEX_TRY_LOCK_FOR(lock_bucket, bucket_mutex, t, this); + if (!lock_bucket.is_locked()) { + // we couldn't get the bucket lock, let's just reschedule and try later. + Debug("hostdb", "iterateEvent event=%d eventp=%p: reschedule due to not getting bucket mutex", event, e); + mutex->thread_holding->schedule_in(this, HOST_DB_RETRY_PERIOD); + return EVENT_CONT; + } + + for (unsigned int l = 0; l < hostDB.levels; ++l) { + HostDBInfo *r = reinterpret_cast(hostDB.data + hostDB.level_offset[l] + hostDB.bucketsize[l] * current_iterate_pos); + if (!r->deleted && !r->failed()) { + action.continuation->handleEvent(EVENT_INTERVAL, static_cast(r)); +
[1/3] trafficserver git commit: TS-3440: Connect retries shouldn't happen if the connection has succeeeded and data has been sent
Repository: trafficserver Updated Branches: refs/heads/master 7b0a57f43 -> 0b2c2f96d TS-3440: Connect retries shouldn't happen if the connection has succeeeded and data has been sent Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/440a1451 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/440a1451 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/440a1451 Branch: refs/heads/master Commit: 440a14513e59baf21e55b07f0dd4aa39bac232de Parents: 65fa4ec Author: Brian Geffon Authored: Thu Jul 2 00:08:11 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 2 00:08:11 2015 -0700 -- proxy/http/HttpTransact.cc | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/440a1451/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 59ee0fc..06870ae 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -3643,6 +3643,17 @@ HttpTransact::handle_response_from_server(State *s) s->current.server->set_connect_fail(EUSERS); // too many users handle_server_connection_not_open(s); break; + case CONNECTION_CLOSED: +/* fall through */ + case PARSE_ERROR: +/* fall through */ + case BAD_INCOMING_RESPONSE: { +// this case should not be allowed to retry because we'll end up making another request +DebugTxn("http_trans", "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying..."); +SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE); +handle_server_connection_not_open(s); +break; + } case OPEN_RAW_ERROR: /* fall through */ case CONNECTION_ERROR: @@ -3650,12 +3661,6 @@ HttpTransact::handle_response_from_server(State *s) case STATE_UNDEFINED: /* fall through */ case INACTIVE_TIMEOUT: - /* fall through */ - case PARSE_ERROR: - /* fall through */ - case CONNECTION_CLOSED: - /* fall through */ - case BAD_INCOMING_RESPONSE: // Set to generic I/O error if not already set specifically. if (!s->current.server->had_connect_fail()) s->current.server->set_connect_fail(EIO);
[2/3] trafficserver git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/dc2b07ba Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/dc2b07ba Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/dc2b07ba Branch: refs/heads/master Commit: dc2b07ba90a610024fcf389eb904738f0d80fc80 Parents: 440a145 7b0a57f Author: Brian Geffon Authored: Thu Jul 2 00:08:20 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 2 00:08:20 2015 -0700 -- Makefile.am | 9 +- .../configuration/records.config.en.rst | 6 ++ iocore/hostdb/I_HostDBProcessor.h | 1 - iocore/hostdb/P_HostDBProcessor.h | 10 +- iocore/net/P_SSLConfig.h| 1 + iocore/net/P_SSLNetVConnection.h| 27 + iocore/net/SSLConfig.cc | 3 + iocore/net/SSLNetVConnection.cc | 65 +++- iocore/net/SSLNextProtocolAccept.cc | 3 +- iocore/net/UnixNetVConnection.cc| 23 - mgmt/RecordsConfig.cc | 20 +--- proxy/ProtocolProbeSessionAccept.cc | 33 -- proxy/http/HttpClientSession.cc | 13 +++ proxy/http/HttpSM.cc| 60 ++- tools/changelog.pl | 102 +++ 15 files changed, 312 insertions(+), 64 deletions(-) --
[3/3] trafficserver git commit: TS-3440: Update tests
TS-3440: Update tests Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0b2c2f96 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0b2c2f96 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0b2c2f96 Branch: refs/heads/master Commit: 0b2c2f96d449e4d19858f947fdc2a4bd204631a9 Parents: dc2b07b Author: Brian Geffon Authored: Thu Jul 2 00:10:45 2015 -0700 Committer: Brian Geffon Committed: Thu Jul 2 00:10:45 2015 -0700 -- ci/tsqa/tests/test_connect_attempts.py | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0b2c2f96/ci/tsqa/tests/test_connect_attempts.py -- diff --git a/ci/tsqa/tests/test_connect_attempts.py b/ci/tsqa/tests/test_connect_attempts.py index bb5e1a2..d5b7117 100644 --- a/ci/tsqa/tests/test_connect_attempts.py +++ b/ci/tsqa/tests/test_connect_attempts.py @@ -183,10 +183,6 @@ class TestOriginServerConnectAttempts(helpers.EnvironmentCase): ret = requests.get(url) self.assertEqual(ret.status_code, 504) -# TODO: FIX THIS!!! The test is correct, ATS isn't! -# we should fail in this case-- or at least have a config which lets you control -# TODO: remove once TS-3440 is resolved -@helpers.unittest.expectedFailure def test_partial_response_origin(self): ''' Verify that we get 504s from origins that return a partial_response
trafficserver git commit: Fixing debug build issue introduced by github pull request #234
Repository: trafficserver Updated Branches: refs/heads/master c31e12b49 -> 65fa4ec51 Fixing debug build issue introduced by github pull request #234 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/65fa4ec5 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/65fa4ec5 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/65fa4ec5 Branch: refs/heads/master Commit: 65fa4ec5182bef596b81dc945c1d29a9f13b4360 Parents: c31e12b Author: Brian Geffon Authored: Mon Jun 29 23:14:58 2015 -0700 Committer: Brian Geffon Committed: Mon Jun 29 23:14:58 2015 -0700 -- iocore/hostdb/I_HostDBProcessor.h | 11 --- 1 file changed, 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/65fa4ec5/iocore/hostdb/I_HostDBProcessor.h -- diff --git a/iocore/hostdb/I_HostDBProcessor.h b/iocore/hostdb/I_HostDBProcessor.h index 720401b..05112ff 100644 --- a/iocore/hostdb/I_HostDBProcessor.h +++ b/iocore/hostdb/I_HostDBProcessor.h @@ -271,17 +271,6 @@ struct HostDBInfo { // failure times. This sets the upper bound that we would ever // consider a server down to 2*down_server_timeout if (now + fail_window < last_failure) { -#ifdef DEBUG -// because this region is mmaped, I cann't get anything -// useful from the structure in core files, therefore -// copy the revelvant info to the stack so it will -// be readble in the core -HostDBInfo current_info; -HostDBRoundRobin current_rr; -memcpy(¤t_info, &info[i], sizeof(HostDBInfo)); -memcpy(¤t_rr, this, sizeof(HostDBRoundRobin)); -ink_assert(!"extreme clock skew"); -#endif app.http_data.last_failure = 0; return false; }
trafficserver git commit: TS-3723: Failed remap should log as ERR_INVALID_URL
Repository: trafficserver Updated Branches: refs/heads/master a3e83c11d -> 8dbe5601d TS-3723: Failed remap should log as ERR_INVALID_URL Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8dbe5601 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8dbe5601 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8dbe5601 Branch: refs/heads/master Commit: 8dbe5601d668e183d69a63f041fe10dacd4e3978 Parents: a3e83c1 Author: Brian Geffon Authored: Mon Jun 29 00:06:48 2015 -0700 Committer: Brian Geffon Committed: Mon Jun 29 00:06:48 2015 -0700 -- proxy/http/HttpTransact.cc | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8dbe5601/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index c706c20..59ee0fc 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -845,8 +845,10 @@ HttpTransact::EndRemapRequest(State *s) // socket when there is no host. Need to handle DNS failure elsewhere. } else if (host == NULL) { /* no host */ build_error_response(s, HTTP_STATUS_BAD_REQUEST, "Host Header Required", "request#no_host", NULL); +s->squid_codes.log_code = SQUID_LOG_ERR_INVALID_URL; } else { build_error_response(s, HTTP_STATUS_NOT_FOUND, "Not Found on Accelerator", "urlrouting#no_mapping", NULL); +s->squid_codes.log_code = SQUID_LOG_ERR_INVALID_URL; } s->reverse_proxy = false; goto done; @@ -859,6 +861,7 @@ HttpTransact::EndRemapRequest(State *s) SET_VIA_STRING(VIA_DETAIL_TUNNEL, VIA_DETAIL_TUNNEL_NO_FORWARD); build_error_response(s, HTTP_STATUS_NOT_FOUND, "Not Found", "urlrouting#no_mapping", NULL); + s->squid_codes.log_code = SQUID_LOG_ERR_INVALID_URL; s->reverse_proxy = false; goto done;
trafficserver git commit: TS-3659: Add config to limit max number of websocket connections: UPDATE DOCS
Repository: trafficserver Updated Branches: refs/heads/master 2b2d25714 -> 2ccc2c2ee TS-3659: Add config to limit max number of websocket connections: UPDATE DOCS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2ccc2c2e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2ccc2c2e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2ccc2c2e Branch: refs/heads/master Commit: 2ccc2c2ee2a52c645d69ea713784f0d613b9325c Parents: 2b2d257 Author: Brian Geffon Authored: Wed Jun 10 00:09:47 2015 -0700 Committer: Brian Geffon Committed: Wed Jun 10 00:09:47 2015 -0700 -- doc/reference/configuration/records.config.en.rst | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2ccc2c2e/doc/reference/configuration/records.config.en.rst -- diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst index 2ec8451..de695b0 100644 --- a/doc/reference/configuration/records.config.en.rst +++ b/doc/reference/configuration/records.config.en.rst @@ -1134,6 +1134,11 @@ Congestion Control The low water mark for transaction buffer control. External source I/O is resumed when the total buffer space in use by the transaction is no more than this value. +.. ts:cv:: CONFIG proxy.config.http.websocket.max_number_of_connections INT -1 + :reloadable: + + When enabled >= (``0``), Traffic Server will enforce a maximum number of simultaneous websocket connections. + Negative Response Caching =
[1/2] trafficserver git commit: TS-3659: Add config to limit max number of websocket connections
Repository: trafficserver Updated Branches: refs/heads/master e6f28e18f -> 2b2d25714 TS-3659: Add config to limit max number of websocket connections Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e31ff43e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e31ff43e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e31ff43e Branch: refs/heads/master Commit: e31ff43ee584a628e0391c818d1d238e20c193ce Parents: e6f28e1 Author: Brian Geffon Authored: Tue Jun 9 23:39:19 2015 -0700 Committer: Brian Geffon Committed: Tue Jun 9 23:39:19 2015 -0700 -- mgmt/RecordsConfig.cc | 6 +- proxy/http/HttpConfig.cc | 2 ++ proxy/http/HttpConfig.h| 3 ++- proxy/http/HttpTransact.cc | 14 ++ 4 files changed, 23 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e31ff43e/mgmt/RecordsConfig.cc -- diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index f8577d1..48a5557 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -153,7 +153,11 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.cache.ignore_accept_charset_mismatch", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-2]", RECA_NULL} , - + // + // Websocket configs + // + {RECT_CONFIG, "proxy.config.http.websocket.max_number_of_connections", RECD_INT, "-1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL} + , //## //# //# Redirection http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e31ff43e/proxy/http/HttpConfig.cc -- diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index 7a7e9af..b598111 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -934,6 +934,7 @@ HttpConfig::startup() #endif HttpEstablishStaticConfigLongLong(c.server_max_connections, "proxy.config.http.server_max_connections"); + HttpEstablishStaticConfigLongLong(c.max_websocket_connections, "proxy.config.http.websocket.max_number_of_connections"); HttpEstablishStaticConfigLongLong(c.oride.server_tcp_init_cwnd, "proxy.config.http.server_tcp_init_cwnd"); HttpEstablishStaticConfigLongLong(c.oride.origin_max_connections, "proxy.config.http.origin_max_connections"); HttpEstablishStaticConfigLongLong(c.origin_min_keep_alive_connections, "proxy.config.http.origin_min_keep_alive_connections"); @@ -1209,6 +1210,7 @@ HttpConfig::reconfigure() params->disable_ssl_parenting = INT_TO_BOOL(m_master.disable_ssl_parenting); params->server_max_connections = m_master.server_max_connections; + params->max_websocket_connections = m_master.max_websocket_connections; params->oride.server_tcp_init_cwnd = m_master.oride.server_tcp_init_cwnd; params->oride.origin_max_connections = m_master.oride.origin_max_connections; params->origin_min_keep_alive_connections = m_master.origin_min_keep_alive_connections; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e31ff43e/proxy/http/HttpConfig.h -- diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h index fc3cec8..07b2a4c 100644 --- a/proxy/http/HttpConfig.h +++ b/proxy/http/HttpConfig.h @@ -611,6 +611,7 @@ public: MgmtInt server_max_connections; MgmtInt origin_min_keep_alive_connections; // TODO: This one really ought to be overridable, but difficult right now. MgmtInt attach_server_session_to_client; + MgmtInt max_websocket_connections; MgmtByte parent_proxy_routing_enable; MgmtByte disable_ssl_parenting; @@ -839,7 +840,7 @@ extern volatile int32_t icp_dynamic_enabled; / / inline HttpConfigParams::HttpConfigParams() - : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0), + : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0), max_websocket_connections(-1), parent_proxy_routing_enable(0), 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), use_client_source_port(0), proxy_request_via_string(NULL), proxy_request_via_string_len(0), proxy_response_via_string(NULL), http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e31ff43e/proxy/http/HttpTransact.cc --
[2/2] trafficserver git commit: TS-3659: Add config to limit max number of websocket connections: UPDATE CHANGES
TS-3659: Add config to limit max number of websocket connections: UPDATE CHANGES Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2b2d2571 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2b2d2571 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2b2d2571 Branch: refs/heads/master Commit: 2b2d2571488498e1adcfda4cce349ab1d60b58f8 Parents: e31ff43 Author: Brian Geffon Authored: Tue Jun 9 23:39:41 2015 -0700 Committer: Brian Geffon Committed: Tue Jun 9 23:39:41 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2b2d2571/CHANGES -- diff --git a/CHANGES b/CHANGES index ad9ef5b..3cf8481 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 6.0.0 + *) [TS-3659] Add config to limit max number of websocket connections + *) [TS-3462] Reduce the HostDB lookup timeout to 30s. *) [TS-3045] Change the default TLS threads setting to -1.
[2/2] trafficserver git commit: TS-3664: WebSockets attempts cache lookup and blocks on multiple requests: UPDATE CHANGES
TS-3664: WebSockets attempts cache lookup and blocks on multiple requests: UPDATE CHANGES Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e8b38aea Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e8b38aea Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e8b38aea Branch: refs/heads/master Commit: e8b38aea016fb72a15de9f00d8e3e2abcac600be Parents: 8ee26db Author: Brian Geffon Authored: Wed Jun 3 23:35:27 2015 -0700 Committer: Brian Geffon Committed: Wed Jun 3 23:35:27 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e8b38aea/CHANGES -- diff --git a/CHANGES b/CHANGES index 9a37779..965a907 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 6.0.0 + *) [TS-3664] WebSockets attempts a cache lookup and blocks on multiple requests + *) [TS-3661] keep cache_sm active during 3xx redirect follow to allow for caching the final response.
[1/2] trafficserver git commit: TS-3664: WebSockets attempts cache lookup and blocks on multiple requests
Repository: trafficserver Updated Branches: refs/heads/master 2d8113098 -> e8b38aea0 TS-3664: WebSockets attempts cache lookup and blocks on multiple requests Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8ee26db7 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8ee26db7 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8ee26db7 Branch: refs/heads/master Commit: 8ee26db7919d76e464a203c0d4d7f2d8f98c041d Parents: 2d81130 Author: Brian Geffon Authored: Wed Jun 3 23:35:06 2015 -0700 Committer: Brian Geffon Committed: Wed Jun 3 23:35:06 2015 -0700 -- proxy/http/HttpTransact.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8ee26db7/proxy/http/HttpTransact.cc -- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 961d78b..7e0e6d3 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -1878,7 +1878,7 @@ HttpTransact::DecideCacheLookup(State *s) s->cache_info.action = CACHE_DO_NO_ACTION; s->current.mode = GENERIC_PROXY; } else { -if (is_request_cache_lookupable(s)) { +if (is_request_cache_lookupable(s) && !s->is_upgrade_request) { s->cache_info.action = CACHE_DO_LOOKUP; s->current.mode = GENERIC_PROXY; } else {
[2/3] trafficserver git commit: TS-3631: add config option to limit post size: UPDATE CHANGES
TS-3631: add config option to limit post size: UPDATE CHANGES Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a6eb0bd4 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a6eb0bd4 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a6eb0bd4 Branch: refs/heads/master Commit: a6eb0bd4a92406ce5838098691d7abad261d6a7f Parents: eadc9cf Author: Brian Geffon Authored: Fri May 22 00:22:41 2015 -0700 Committer: Brian Geffon Committed: Fri May 22 00:22:41 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a6eb0bd4/CHANGES -- diff --git a/CHANGES b/CHANGES index 4dc8b33..35222fc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 6.0.0 + *) [TS-3631] Add config option to limit post size + *) [TS-3628] Unable to use disks larger than 16T *) [TS-2080] Remove arbitrary 1 year max age limit on the cache, use
[3/3] trafficserver git commit: TS-3631: add config option to limit post size: UPDATE DOCS
TS-3631: add config option to limit post size: UPDATE DOCS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/be6c95ba Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/be6c95ba Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/be6c95ba Branch: refs/heads/master Commit: be6c95ba2778e6c871f935c991695403f7ca5a57 Parents: a6eb0bd Author: Brian Geffon Authored: Fri May 22 00:25:11 2015 -0700 Committer: Brian Geffon Committed: Fri May 22 00:25:11 2015 -0700 -- doc/reference/configuration/records.config.en.rst | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/be6c95ba/doc/reference/configuration/records.config.en.rst -- diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst index 1435895..694d338 100644 --- a/doc/reference/configuration/records.config.en.rst +++ b/doc/reference/configuration/records.config.en.rst @@ -1204,6 +1204,14 @@ Security a filtering rule in the ip_allow.config file to allow only certain machines to push content into the cache. +.. ts:cv:: CONFIG proxy.config.http.max_post_size INT 0 + :reloadable: + + This feature is disabled by default with a value of (``0``), any positive + value will limit the size of post bodies. If a request is received with a + post body larger than this limit the response will be terminated with + 413 - Request Entity Too Large and logged accordingly. + Cache Control =
[1/3] trafficserver git commit: TS-3631: add config option to limit post size
Repository: trafficserver Updated Branches: refs/heads/master 9725e10f8 -> be6c95ba2 TS-3631: add config option to limit post size Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/eadc9cfa Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/eadc9cfa Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/eadc9cfa Branch: refs/heads/master Commit: eadc9cfa4020799859c4c65be6608990b6f0fe80 Parents: 9725e10 Author: Brian Geffon Authored: Fri May 22 00:22:24 2015 -0700 Committer: Brian Geffon Committed: Fri May 22 00:22:24 2015 -0700 -- mgmt/RecordsConfig.cc | 3 ++- proxy/hdrs/HTTP.h | 1 + proxy/http/HttpConfig.cc | 7 ++- proxy/http/HttpConfig.h| 4 +++- proxy/http/HttpTransact.cc | 10 ++ proxy/logging/Log.cc | 1 + 6 files changed, 23 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eadc9cfa/mgmt/RecordsConfig.cc -- diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 8fa1ba4..ebcb8fd 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -482,7 +482,8 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.auth_server_session_private", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL} , - + {RECT_CONFIG, "proxy.config.http.max_post_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "^[0-9]+$", RECA_NULL} + , //## //# parent proxy configuration # //## http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eadc9cfa/proxy/hdrs/HTTP.h -- diff --git a/proxy/hdrs/HTTP.h b/proxy/hdrs/HTTP.h index 78de824..a1f6e8f 100644 --- a/proxy/hdrs/HTTP.h +++ b/proxy/hdrs/HTTP.h @@ -136,6 +136,7 @@ enum SquidLogCode { SQUID_LOG_UDP_FUTURE_2 = 'o', SQUID_LOG_ERR_READ_TIMEOUT = 'p', SQUID_LOG_ERR_LIFETIME_EXP = 'q', + SQUID_LOG_ERR_POST_ENTITY_TOO_LARGE = 'L', SQUID_LOG_ERR_NO_CLIENTS_BIG_OBJ = 'r', SQUID_LOG_ERR_READ_ERROR = 's', SQUID_LOG_ERR_CLIENT_ABORT = 't', http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eadc9cfa/proxy/http/HttpConfig.cc -- diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index 1b36d2e..54955e5 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -854,7 +854,9 @@ register_stat_callbacks() (int)https_incoming_requests_stat, RecRawStatSyncCount); RecRegisterRawStat(http_rsb, RECT_PROCESS, "proxy.process.https.total_client_connections", RECD_COUNTER, RECP_PERSISTENT, (int)https_total_client_connections_stat, RecRawStatSyncCount); - + RecRegisterRawStat(http_rsb, RECT_PROCESS, + "proxy.process.http.post_body_too_large", + RECD_COUNTER, RECP_PERSISTENT, (int) http_post_body_too_large, RecRawStatSyncCount); // milestones RecRegisterRawStat(http_rsb, RECT_PROCESS, "proxy.process.http.milestone.ua_begin", RECD_COUNTER, RECP_PERSISTENT, (int)http_ua_begin_time_stat, RecRawStatSyncSum); @@ -1146,6 +1148,8 @@ HttpConfig::startup() // Stat Page Info HttpEstablishStaticConfigByte(c.enable_http_info, "proxy.config.http.enable_http_info"); + HttpEstablishStaticConfigLongLong(c.max_post_size, "proxy.config.http.max_post_size"); + //## //# //# Redirection @@ -1361,6 +1365,7 @@ HttpConfig::reconfigure() params->cache_open_write_fail_action = m_master.cache_open_write_fail_action; params->oride.cache_when_to_revalidate = m_master.oride.cache_when_to_revalidate; + params->max_post_size = m_master.max_post_size; params->oride.cache_required_headers = m_master.oride.cache_required_headers; params->oride.cache_range_lookup = INT_TO_BOOL(m_master.oride.cache_range_lookup); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/eadc9cfa/proxy/http/HttpConfig.h -- diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h index 813e4df..4534c6c 100644 --- a/proxy/http/HttpConfig.h +++ b/proxy/http/HttpConfig.h @@ -228,6 +228,7 @@ enum { http_ua_msecs_counts_other_unclassified_stat, disallowed_post_100_continue, + http_post_body_too_large, http_total_x_redirect_stat, @@ -744,6 +745,7 @@ public: MgmtByte disallow_post_100_continue; MgmtByte parser_allow_non_http; MgmtInt cache_open_write_fail_action; + MgmtInt max_post_size;
trafficserver git commit: TS-3618: crashes in traffic_cop on shutdown
Repository: trafficserver Updated Branches: refs/heads/master 6f0b8c8ea -> edc8fbc92 TS-3618: crashes in traffic_cop on shutdown Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/edc8fbc9 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/edc8fbc9 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/edc8fbc9 Branch: refs/heads/master Commit: edc8fbc923a62111c15965499d9b2b91a212fc57 Parents: 6f0b8c8 Author: Brian Geffon Authored: Wed May 20 18:25:45 2015 -0700 Committer: Brian Geffon Committed: Wed May 20 18:25:45 2015 -0700 -- cmd/traffic_cop/traffic_cop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/edc8fbc9/cmd/traffic_cop/traffic_cop.cc -- diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc index 1a9ebad..7adf89f 100644 --- a/cmd/traffic_cop/traffic_cop.cc +++ b/cmd/traffic_cop/traffic_cop.cc @@ -271,7 +271,7 @@ sig_term(int signum) child_status = status; } cop_log_trace("Leaving sig_term(%d), exiting traffic_cop\n", signum); - exit(0); + _exit(0); } static void
[2/2] trafficserver git commit: Revert "TS-3618: Crashes in traffic_cop on shutdown / restart"
Revert "TS-3618: Crashes in traffic_cop on shutdown / restart" This reverts commit 591984cf0a288d0ac51c5d49fed7faf1f07d2a9f. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6f0b8c8e Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6f0b8c8e Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6f0b8c8e Branch: refs/heads/master Commit: 6f0b8c8ea7cc5f20a4f141f12e1b9768c696dbc4 Parents: 0b8029a Author: Brian Geffon Authored: Wed May 20 18:23:41 2015 -0700 Committer: Brian Geffon Committed: Wed May 20 18:23:41 2015 -0700 -- cmd/traffic_cop/traffic_cop.cc | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6f0b8c8e/cmd/traffic_cop/traffic_cop.cc -- diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc index a535cdf..1a9ebad 100644 --- a/cmd/traffic_cop/traffic_cop.cc +++ b/cmd/traffic_cop/traffic_cop.cc @@ -81,7 +81,6 @@ static int coresig = 0; static int debug_flag = false; static int stdout_flag = false; static int stop_flag = false; -static volatile int sig_term_received = 0; static char *admin_user; static uid_t admin_uid; @@ -272,7 +271,7 @@ sig_term(int signum) child_status = status; } cop_log_trace("Leaving sig_term(%d), exiting traffic_cop\n", signum); - sig_term_received = 1; + exit(0); } static void @@ -829,15 +828,7 @@ poll_read_or_write(int fd, int timeout, int inorout) info.revents = 0; do { -if (sig_term_received) { - exit(0); -} - err = poll(&info, 1, timeout); - -if (sig_term_received) { - exit(0); -} } while ((err < 0) && (transient_error(errno, TRANSIENT_ERROR_WAIT_MS))); if ((err > 0) && (info.revents & inorout)) {
[1/2] trafficserver git commit: Revert "TS-3618 clang-format"
Repository: trafficserver Updated Branches: refs/heads/master 6565d4174 -> 6f0b8c8ea Revert "TS-3618 clang-format" This reverts commit 5e2f35626ca13b0bd66b21e4d8c549a382485f42. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0b8029ae Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0b8029ae Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0b8029ae Branch: refs/heads/master Commit: 0b8029ae3dda283da9ed6277e37132aa4e268f2a Parents: 6565d41 Author: Brian Geffon Authored: Wed May 20 18:23:35 2015 -0700 Committer: Brian Geffon Committed: Wed May 20 18:23:35 2015 -0700 -- cmd/traffic_cop/traffic_cop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0b8029ae/cmd/traffic_cop/traffic_cop.cc -- diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc index 23e9e2b..a535cdf 100644 --- a/cmd/traffic_cop/traffic_cop.cc +++ b/cmd/traffic_cop/traffic_cop.cc @@ -830,7 +830,7 @@ poll_read_or_write(int fd, int timeout, int inorout) do { if (sig_term_received) { - exit(0); + exit(0); } err = poll(&info, 1, timeout);
[2/2] trafficserver git commit: TS-3618: Crashes in traffic_cop on shutdown / restart: UPDATE CHANGES
TS-3618: Crashes in traffic_cop on shutdown / restart: UPDATE CHANGES Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3ea9ccc3 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3ea9ccc3 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3ea9ccc3 Branch: refs/heads/master Commit: 3ea9ccc302557a308549fc23cb0d078cbcd9ec1d Parents: 591984c Author: Brian Geffon Authored: Mon May 18 19:47:03 2015 -0700 Committer: Brian Geffon Committed: Mon May 18 19:47:03 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3ea9ccc3/CHANGES -- diff --git a/CHANGES b/CHANGES index 59a9b8e..fe2591f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 6.0.0 + *) [TS-3618] Crashes in traffic_cop on shutdown / restart + *) [TS-3617] cache_promote leaks the URL string. *) [TS-3581] Remove unused parameters from Cache::remove().
[1/2] trafficserver git commit: TS-3618: Crashes in traffic_cop on shutdown / restart
Repository: trafficserver Updated Branches: refs/heads/master 37569c139 -> 3ea9ccc30 TS-3618: Crashes in traffic_cop on shutdown / restart Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/591984cf Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/591984cf Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/591984cf Branch: refs/heads/master Commit: 591984cf0a288d0ac51c5d49fed7faf1f07d2a9f Parents: 37569c1 Author: Brian Geffon Authored: Mon May 18 19:46:38 2015 -0700 Committer: Brian Geffon Committed: Mon May 18 19:46:38 2015 -0700 -- cmd/traffic_cop/traffic_cop.cc | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/591984cf/cmd/traffic_cop/traffic_cop.cc -- diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc index 1a9ebad..a535cdf 100644 --- a/cmd/traffic_cop/traffic_cop.cc +++ b/cmd/traffic_cop/traffic_cop.cc @@ -81,6 +81,7 @@ static int coresig = 0; static int debug_flag = false; static int stdout_flag = false; static int stop_flag = false; +static volatile int sig_term_received = 0; static char *admin_user; static uid_t admin_uid; @@ -271,7 +272,7 @@ sig_term(int signum) child_status = status; } cop_log_trace("Leaving sig_term(%d), exiting traffic_cop\n", signum); - exit(0); + sig_term_received = 1; } static void @@ -828,7 +829,15 @@ poll_read_or_write(int fd, int timeout, int inorout) info.revents = 0; do { +if (sig_term_received) { + exit(0); +} + err = poll(&info, 1, timeout); + +if (sig_term_received) { + exit(0); +} } while ((err < 0) && (transient_error(errno, TRANSIENT_ERROR_WAIT_MS))); if ((err > 0) && (info.revents & inorout)) {
[2/2] trafficserver git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/cc40b928 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/cc40b928 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/cc40b928 Branch: refs/heads/master Commit: cc40b928bf9d3645f3620bafe233fe289ae60a0e Parents: 03d091f 110b99a Author: Brian Geffon Authored: Sun May 17 22:24:50 2015 -0700 Committer: Brian Geffon Committed: Sun May 17 22:24:50 2015 -0700 -- CHANGES | 46 +- ci/rat-regex.txt|2 + ci/tsqa/Makefile| 29 +- ci/tsqa/README.rst |2 + ci/tsqa/tests/helpers.py|3 +- ci/tsqa/tests/test_hostdb.py|5 + cmd/traffic_top/traffic_top.cc |2 +- doc/reference/plugins/cache_promote.en.rst |2 +- doc/reference/plugins/header_rewrite.en.rst | 22 +- iocore/cache/Cache.cc |2 +- iocore/net/Makefile.am |3 + iocore/net/OCSPStapling.cc | 11 +- iocore/net/P_NetAccept.h|4 +- iocore/net/P_OCSPStapling.h |2 +- iocore/net/P_SSLClientUtils.h | 39 + iocore/net/P_SSLNetAccept.h |2 +- iocore/net/P_SSLUtils.h |6 +- iocore/net/SSLClientUtils.cc| 186 ++ iocore/net/SSLConfig.cc |4 +- iocore/net/SSLNetAccept.cc |4 +- iocore/net/SSLNetProcessor.cc |2 +- iocore/net/SSLNetVConnection.cc |4 + iocore/net/SSLUtils.cc | 214 +- iocore/net/UnixNetAccept.cc | 14 +- iocore/net/UnixNetProcessor.cc |6 +- lib/ts/Makefile.am | 10 +- lib/ts/X509HostnameValidator.cc | 270 +++ lib/ts/X509HostnameValidator.h | 39 + lib/ts/apidefs.h.in | 2124 +- lib/ts/libts.h |1 + lib/ts/test_X509HostnameValidator.cc| 183 ++ plugins/cacheurl/cacheurl.cc|9 +- plugins/experimental/ats_pagespeed/Makefile |8 +- plugins/experimental/ats_pagespeed/README.md| 15 +- .../experimental/ats_pagespeed/ats_pagespeed.cc | 174 +- .../experimental/ats_pagespeed/ats_pagespeed.h | 18 +- .../ats_pagespeed/ats_process_context.cc|1 + .../ats_pagespeed/ats_resource_intercept.cc | 59 +- plugins/experimental/ats_pagespeed/gzip/misc.h |6 +- .../experimental/background_fetch/Makefile.am |2 +- .../background_fetch/background_fetch.cc| 604 ++--- .../experimental/background_fetch/configs.cc| 124 + plugins/experimental/background_fetch/configs.h | 90 + .../experimental/background_fetch/headers.cc| 129 ++ plugins/experimental/background_fetch/headers.h | 32 + plugins/experimental/background_fetch/rules.cc | 175 ++ plugins/experimental/background_fetch/rules.h | 70 + plugins/experimental/spdy/Makefile.am | 56 - plugins/experimental/spdy/TODO | 20 - plugins/experimental/spdy/http.cc | 264 --- plugins/experimental/spdy/http.h| 89 - plugins/experimental/spdy/io.cc | 89 - plugins/experimental/spdy/io.h | 181 -- plugins/experimental/spdy/lib/base/atomic.h | 62 - plugins/experimental/spdy/lib/base/inet.h | 78 - plugins/experimental/spdy/lib/base/logging.cc | 48 - plugins/experimental/spdy/lib/base/logging.h| 72 - plugins/experimental/spdy/lib/spdy/message.cc | 506 - plugins/experimental/spdy/lib/spdy/spdy.h | 306 --- plugins/experimental/spdy/lib/spdy/zstream.cc | 129 -- plugins/experimental/spdy/lib/spdy/zstream.h| 121 - plugins/experimental/spdy/protocol.cc | 168 -- plugins/experimental/spdy/protocol.h| 31 - plugins/experimental/spdy/spdy.cc | 363 --- plugins/experimental/spdy/stream.cc | 351 --- plugins/experimental/spdy/strings.cc| 100 - plugins/experimental/spdy/tests/stubs.cc| 39 - plugins/experimental/spdy/tests/zstream_test.cc | 194 -- plugins/experimental/xdebug/xdebug.cc |2 + plugins/header_rewrite/conditions.cc| 58 +- plugins/header_rewrite/conditions.h |7 +- plugins/header_rewrite/factory.cc | 12 +- plugins/header_rewrite/header_rewrite.cc| 57 +- plugins/header_r
[1/2] trafficserver git commit: Optimization around ssl error logging
Repository: trafficserver Updated Branches: refs/heads/master 110b99ab1 -> cc40b928b Optimization around ssl error logging Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/03d091f3 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/03d091f3 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/03d091f3 Branch: refs/heads/master Commit: 03d091f308ab97c3bac1d5e44ce746988e188c44 Parents: c9fe5c2 Author: Brian Geffon Authored: Sun May 17 22:24:36 2015 -0700 Committer: Brian Geffon Committed: Sun May 17 22:24:36 2015 -0700 -- iocore/net/SSLUtils.cc | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/03d091f3/iocore/net/SSLUtils.cc -- diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc index 1d61a8a..9b60547 100644 --- a/iocore/net/SSLUtils.cc +++ b/iocore/net/SSLUtils.cc @@ -2037,7 +2037,7 @@ SSLWriteBuffer(SSL *ssl, const void *buf, int64_t nbytes, int64_t &nwritten) return SSL_ERROR_NONE; } int ssl_error = SSL_get_error(ssl, ret); - if (ssl_error == SSL_ERROR_SSL) { + if (ssl_error == SSL_ERROR_SSL && is_debug_tag_set("ssl.error.write")) { char buf[512]; unsigned long e = ERR_peek_last_error(); ERR_error_string_n(e, buf, sizeof(buf)); @@ -2061,7 +2061,7 @@ SSLReadBuffer(SSL *ssl, void *buf, int64_t nbytes, int64_t &nread) return SSL_ERROR_NONE; } int ssl_error = SSL_get_error(ssl, ret); - if (ssl_error == SSL_ERROR_SSL) { + if (ssl_error == SSL_ERROR_SSL && is_debug_tag_set("ssl.error.read")) { char buf[512]; unsigned long e = ERR_peek_last_error(); ERR_error_string_n(e, buf, sizeof(buf)); @@ -2080,7 +2080,7 @@ SSLAccept(SSL *ssl) return SSL_ERROR_NONE; } int ssl_error = SSL_get_error(ssl, ret); - if (ssl_error == SSL_ERROR_SSL) { + if (ssl_error == SSL_ERROR_SSL && is_debug_tag_set("ssl.error.accept")) { char buf[512]; unsigned long e = ERR_peek_last_error(); ERR_error_string_n(e, buf, sizeof(buf)); @@ -2099,7 +2099,7 @@ SSLConnect(SSL *ssl) return SSL_ERROR_NONE; } int ssl_error = SSL_get_error(ssl, ret); - if (ssl_error == SSL_ERROR_SSL) { + if (ssl_error == SSL_ERROR_SSL && is_debug_tag_set("ssl.error.connect")) { char buf[512]; unsigned long e = ERR_peek_last_error(); ERR_error_string_n(e, buf, sizeof(buf));
trafficserver git commit: TS-3582: Change @dst_ip to @in_ip: UPDATE CHANGES
Repository: trafficserver Updated Branches: refs/heads/master f28e76608 -> c9fe5c218 TS-3582: Change @dst_ip to @in_ip: UPDATE CHANGES Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c9fe5c21 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c9fe5c21 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c9fe5c21 Branch: refs/heads/master Commit: c9fe5c218ea8d999483c4280664cf2fc7b47261d Parents: f28e766 Author: Brian Geffon Authored: Tue May 5 20:21:17 2015 -0700 Committer: Brian Geffon Committed: Tue May 5 20:21:17 2015 -0700 -- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c9fe5c21/CHANGES -- diff --git a/CHANGES b/CHANGES index d987db8..4b8f9ea 100644 --- a/CHANGES +++ b/CHANGES @@ -6,7 +6,7 @@ Changes with Apache Traffic Server 6.0.0 *) [TS-2513] Missing SOCKS documentation - *) [TS-3582] Add @dst_ip to remap filters + *) [TS-3582] Add @in_ip to remap filters *) [TS-3484] Make inactivity_cop frequency (schedule) configurable, proxy.config.net.inactivity_check_frequency.
[1/2] trafficserver git commit: TS-3582: Change @dst_ip to @in_ip
Repository: trafficserver Updated Branches: refs/heads/master d8a753876 -> f28e76608 TS-3582: Change @dst_ip to @in_ip Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/48e3670c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/48e3670c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/48e3670c Branch: refs/heads/master Commit: 48e3670cfe60e1e1601aa56f3cb834645f7508df Parents: d8a7538 Author: Brian Geffon Authored: Tue May 5 20:17:04 2015 -0700 Committer: Brian Geffon Committed: Tue May 5 20:17:04 2015 -0700 -- proxy/http/remap/AclFiltering.cc | 16 proxy/http/remap/AclFiltering.h | 10 +- proxy/http/remap/RemapConfig.cc | 34 +- proxy/http/remap/RemapConfig.h | 2 +- proxy/http/remap/UrlRewrite.cc | 18 -- 5 files changed, 43 insertions(+), 37 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/48e3670c/proxy/http/remap/AclFiltering.cc -- diff --git a/proxy/http/remap/AclFiltering.cc b/proxy/http/remap/AclFiltering.cc index f05e41e..6a545f3 100644 --- a/proxy/http/remap/AclFiltering.cc +++ b/proxy/http/remap/AclFiltering.cc @@ -46,10 +46,10 @@ acl_filter_rule::reset(void) src_ip_array[i].reset(); } src_ip_valid = 0; - for (i = (dst_ip_cnt = 0); i < ACL_FILTER_MAX_DST_IP; i++) { -dst_ip_array[i].reset(); + for (i = (in_ip_cnt = 0); i < ACL_FILTER_MAX_IN_IP; i++) { +in_ip_array[i].reset(); } - dst_ip_valid = 0; + in_ip_valid = 0; internal = 0; } @@ -96,9 +96,9 @@ acl_filter_rule::print(void) { int i; printf("-\n"); - printf("Filter \"%s\" status: allow_flag=%s, src_ip_valid=%s, dst_ip_valid=%s, internal=%s, active_queue_flag=%d\n", + printf("Filter \"%s\" status: allow_flag=%s, src_ip_valid=%s, in_ip_valid=%s, internal=%s, active_queue_flag=%d\n", filter_name ? filter_name : "", allow_flag ? "true" : "false", src_ip_valid ? "true" : "false", - dst_ip_valid ? "true" : "false", internal ? "true" : "false", (int)active_queue_flag); + in_ip_valid ? "true" : "false", internal ? "true" : "false", (int)active_queue_flag); printf("standard methods="); for (i = 0; i < HTTP_WKSIDX_METHODS_CNT; i++) { if (standard_method_lookup[i]) { @@ -116,10 +116,10 @@ acl_filter_rule::print(void) printf("%s - %s", ats_ip_ntop(&src_ip_array[i].start.sa, b1, sizeof(b1)), ats_ip_ntop(&src_ip_array[i].end.sa, b2, sizeof(b2))); } printf("\n"); - printf("dst_ip_cnt=%d\n", dst_ip_cnt); - for (i = 0; i < dst_ip_cnt; i++) { + printf("in_ip_cnt=%d\n", in_ip_cnt); + for (i = 0; i < in_ip_cnt; i++) { ip_text_buffer b1, b2; -printf("%s - %s", ats_ip_ntop(&dst_ip_array[i].start.sa, b1, sizeof(b1)), ats_ip_ntop(&dst_ip_array[i].end.sa, b2, sizeof(b2))); +printf("%s - %s", ats_ip_ntop(&in_ip_array[i].start.sa, b1, sizeof(b1)), ats_ip_ntop(&in_ip_array[i].end.sa, b2, sizeof(b2))); } printf("\n"); for (i = 0; i < argc; i++) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/48e3670c/proxy/http/remap/AclFiltering.h -- diff --git a/proxy/http/remap/AclFiltering.h b/proxy/http/remap/AclFiltering.h index 0eb2ee2..345ede3 100644 --- a/proxy/http/remap/AclFiltering.h +++ b/proxy/http/remap/AclFiltering.h @@ -35,7 +35,7 @@ // ACL like filtering defs (per one remap rule) static int const ACL_FILTER_MAX_SRC_IP = 128; -static int const ACL_FILTER_MAX_DST_IP = 8; +static int const ACL_FILTER_MAX_IN_IP = 8; static int const ACL_FILTER_MAX_ARGV = 512; struct src_ip_info_t { @@ -72,7 +72,7 @@ public: char *filter_name; // optional filter name unsigned int allow_flag : 1, // action allow deny src_ip_valid : 1, // src_ip range valid -dst_ip_valid : 1, +in_ip_valid : 1, active_queue_flag : 1, // filter is in active state (used by .useflt directive) internal : 1; // filter internal HTTP requests @@ -91,9 +91,9 @@ public: int src_ip_cnt; // how many valid src_ip rules we have src_ip_info_t src_ip_array[ACL_FILTER_MAX_SRC_IP]; - // dst_ip - int dst_ip_cnt; // how many valid dst_ip rules we have - src_ip_info_t dst_ip_array[ACL_FILTER_MAX_DST_IP]; + // in_ip + int in_ip_cnt; // how many valid dst_ip rules we have + src_ip_info_t in_ip_array[ACL_FILTER_MAX_IN_IP]; acl_filter_rule(); ~acl_filter_rule(); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/48e3670c/proxy/http/remap/RemapConfig.cc --
[2/2] trafficserver git commit: TS-3582: Change @dst_ip to @in_ip: UPDATE DOCS
TS-3582: Change @dst_ip to @in_ip: UPDATE DOCS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f28e7660 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f28e7660 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f28e7660 Branch: refs/heads/master Commit: f28e766080c8f88c2ed0d36400a2aee0b8e17396 Parents: 48e3670 Author: Brian Geffon Authored: Tue May 5 20:18:11 2015 -0700 Committer: Brian Geffon Committed: Tue May 5 20:18:11 2015 -0700 -- doc/reference/configuration/remap.config.en.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f28e7660/doc/reference/configuration/remap.config.en.rst -- diff --git a/doc/reference/configuration/remap.config.en.rst b/doc/reference/configuration/remap.config.en.rst index 35e996f..f870fe0 100644 --- a/doc/reference/configuration/remap.config.en.rst +++ b/doc/reference/configuration/remap.config.en.rst @@ -393,14 +393,14 @@ Examples map http://foo.example.com/ http://foo.example.com/ @action=deny @src_ip=1.2.3.4 map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=127.0.0.1 -map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=10.5.2.1 @dst_ip=72.209.23.4 +map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=10.5.2.1 @in_ip=72.209.23.4 map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=127.0.0.1 @method=post @method=get @method=head Note that these Acl filters will return a 403 response if the resource is restricted. -The difference between ``@src_ip`` and ``@dst_ip`` is that the ``@src_ip`` is the client -ip and the ``dst_ip`` is the ip address the client is connecting to (the incoming address). +The difference between ``@src_ip`` and ``@in_ip`` is that the ``@src_ip`` is the client +ip and the ``in_ip`` is the ip address the client is connecting to (the incoming address). Named Filters =
[1/3] trafficserver git commit: TS-3582: Add @dst_ip to remap filters
Repository: trafficserver Updated Branches: refs/heads/master e521a6f84 -> 825c351d7 TS-3582: Add @dst_ip to remap filters Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3a36535f Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3a36535f Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3a36535f Branch: refs/heads/master Commit: 3a36535fe6f41ab74bce8704a5d1060482efc50b Parents: e521a6f Author: Brian Geffon Authored: Mon May 4 23:58:38 2015 -0700 Committer: Brian Geffon Committed: Mon May 4 23:58:38 2015 -0700 -- proxy/http/remap/AclFiltering.cc | 15 +-- proxy/http/remap/AclFiltering.h | 7 + proxy/http/remap/RemapConfig.cc | 51 +++ proxy/http/remap/RemapConfig.h | 1 + proxy/http/remap/UrlRewrite.cc | 20 ++ 5 files changed, 92 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3a36535f/proxy/http/remap/AclFiltering.cc -- diff --git a/proxy/http/remap/AclFiltering.cc b/proxy/http/remap/AclFiltering.cc index bcd97b9..f05e41e 100644 --- a/proxy/http/remap/AclFiltering.cc +++ b/proxy/http/remap/AclFiltering.cc @@ -46,6 +46,10 @@ acl_filter_rule::reset(void) src_ip_array[i].reset(); } src_ip_valid = 0; + for (i = (dst_ip_cnt = 0); i < ACL_FILTER_MAX_DST_IP; i++) { +dst_ip_array[i].reset(); + } + dst_ip_valid = 0; internal = 0; } @@ -92,9 +96,9 @@ acl_filter_rule::print(void) { int i; printf("-\n"); - printf("Filter \"%s\" status: allow_flag=%s, src_ip_valid=%s, internal=%s, active_queue_flag=%d\n", + printf("Filter \"%s\" status: allow_flag=%s, src_ip_valid=%s, dst_ip_valid=%s, internal=%s, active_queue_flag=%d\n", filter_name ? filter_name : "", allow_flag ? "true" : "false", src_ip_valid ? "true" : "false", - internal ? "true" : "false", (int)active_queue_flag); + dst_ip_valid ? "true" : "false", internal ? "true" : "false", (int)active_queue_flag); printf("standard methods="); for (i = 0; i < HTTP_WKSIDX_METHODS_CNT; i++) { if (standard_method_lookup[i]) { @@ -111,6 +115,13 @@ acl_filter_rule::print(void) ip_text_buffer b1, b2; printf("%s - %s", ats_ip_ntop(&src_ip_array[i].start.sa, b1, sizeof(b1)), ats_ip_ntop(&src_ip_array[i].end.sa, b2, sizeof(b2))); } + printf("\n"); + printf("dst_ip_cnt=%d\n", dst_ip_cnt); + for (i = 0; i < dst_ip_cnt; i++) { +ip_text_buffer b1, b2; +printf("%s - %s", ats_ip_ntop(&dst_ip_array[i].start.sa, b1, sizeof(b1)), ats_ip_ntop(&dst_ip_array[i].end.sa, b2, sizeof(b2))); + } + printf("\n"); for (i = 0; i < argc; i++) { printf("argv[%d] = \"%s\"\n", i, argv[i]); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3a36535f/proxy/http/remap/AclFiltering.h -- diff --git a/proxy/http/remap/AclFiltering.h b/proxy/http/remap/AclFiltering.h index d7ff788..0eb2ee2 100644 --- a/proxy/http/remap/AclFiltering.h +++ b/proxy/http/remap/AclFiltering.h @@ -35,6 +35,7 @@ // ACL like filtering defs (per one remap rule) static int const ACL_FILTER_MAX_SRC_IP = 128; +static int const ACL_FILTER_MAX_DST_IP = 8; static int const ACL_FILTER_MAX_ARGV = 512; struct src_ip_info_t { @@ -71,6 +72,7 @@ public: char *filter_name; // optional filter name unsigned int allow_flag : 1, // action allow deny src_ip_valid : 1, // src_ip range valid +dst_ip_valid : 1, active_queue_flag : 1, // filter is in active state (used by .useflt directive) internal : 1; // filter internal HTTP requests @@ -88,6 +90,11 @@ public: // src_ip int src_ip_cnt; // how many valid src_ip rules we have src_ip_info_t src_ip_array[ACL_FILTER_MAX_SRC_IP]; + + // dst_ip + int dst_ip_cnt; // how many valid dst_ip rules we have + src_ip_info_t dst_ip_array[ACL_FILTER_MAX_DST_IP]; + acl_filter_rule(); ~acl_filter_rule(); void name(const char *_name = NULL); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3a36535f/proxy/http/remap/RemapConfig.cc -- diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc index c8af9d1..1f458e2 100644 --- a/proxy/http/remap/RemapConfig.cc +++ b/proxy/http/remap/RemapConfig.cc @@ -470,6 +470,45 @@ remap_validate_filter_args(acl_filter_rule **rule_pp, const char **argv, int arg } } +if (ul & REMAP_OPTFLG_DST_IP) { /* "dst_ip=" option */ + if (rule->dst_ip_cnt >= ACL_FILTER_MAX_DST_IP) { +
[3/3] trafficserver git commit: TS-3582: Update Docs
TS-3582: Update Docs Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/825c351d Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/825c351d Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/825c351d Branch: refs/heads/master Commit: 825c351d7b484eb4b28cb6e320a085324335b669 Parents: dff41cf Author: Brian Geffon Authored: Tue May 5 00:01:03 2015 -0700 Committer: Brian Geffon Committed: Tue May 5 00:02:17 2015 -0700 -- doc/reference/configuration/remap.config.en.rst | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/825c351d/doc/reference/configuration/remap.config.en.rst -- diff --git a/doc/reference/configuration/remap.config.en.rst b/doc/reference/configuration/remap.config.en.rst index db1bc5f..35e996f 100644 --- a/doc/reference/configuration/remap.config.en.rst +++ b/doc/reference/configuration/remap.config.en.rst @@ -392,11 +392,16 @@ Examples map http://foo.example.com/ http://foo.example.com/ @action=deny @src_ip=1.2.3.4 map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=127.0.0.1 + +map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=10.5.2.1 @dst_ip=72.209.23.4 map http://foo.example.com/ http://foo.example.com/ @action=allow @src_ip=127.0.0.1 @method=post @method=get @method=head Note that these Acl filters will return a 403 response if the resource is restricted. +The difference between ``@src_ip`` and ``@dst_ip`` is that the ``@src_ip`` is the client +ip and the ``dst_ip`` is the ip address the client is connecting to (the incoming address). + Named Filters = @@ -413,6 +418,7 @@ is helpful for remapping internal requests without allowing access to external users. By default both internal and external requests are allowed. + Examples
[2/3] trafficserver git commit: TS-3582: Update Changes
TS-3582: Update Changes Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/dff41cfe Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/dff41cfe Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/dff41cfe Branch: refs/heads/master Commit: dff41cfe6a490e8780bcbefd64c3bcdfd533159b Parents: 3a36535 Author: Brian Geffon Authored: Mon May 4 23:59:00 2015 -0700 Committer: Brian Geffon Committed: Mon May 4 23:59:00 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dff41cfe/CHANGES -- diff --git a/CHANGES b/CHANGES index 3639131..5f03a3d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 6.0.0 + *) [TS-3582] Add @dst_ip to remap filters + *) [TS-3484] Make inactivity_cop frequency (schedule) configurable, proxy.config.net.inactivity_check_frequency.
trafficserver git commit: Adding new API to C++ api for Cache Status
Repository: trafficserver Updated Branches: refs/heads/master 31c544114 -> 523b47493 Adding new API to C++ api for Cache Status Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/523b4749 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/523b4749 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/523b4749 Branch: refs/heads/master Commit: 523b47493b446bcacb69102cbb6b9e9a498b584d Parents: 31c5441 Author: Brian Geffon Authored: Thu Apr 30 11:07:42 2015 -0700 Committer: Brian Geffon Committed: Thu Apr 30 11:07:42 2015 -0700 -- lib/atscppapi/src/Transaction.cc| 23 .../src/include/atscppapi/Transaction.h | 13 +++ 2 files changed, 36 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/523b4749/lib/atscppapi/src/Transaction.cc -- diff --git a/lib/atscppapi/src/Transaction.cc b/lib/atscppapi/src/Transaction.cc index 4ff6319..9254d8c 100644 --- a/lib/atscppapi/src/Transaction.cc +++ b/lib/atscppapi/src/Transaction.cc @@ -303,6 +303,29 @@ Transaction::setTimeout(Transaction::TimeoutType type, int time_ms) } } + +Transaction::CacheStatus +Transaction::getCacheStatus() { + int obj_status = TS_ERROR; + + if (TSHttpTxnCacheLookupStatusGet(state_->txn_, &obj_status) == TS_ERROR) { +return CACHE_LOOKUP_NONE; + } + + switch (obj_status) { + case TS_CACHE_LOOKUP_MISS: +return CACHE_LOOKUP_MISS; + case TS_CACHE_LOOKUP_HIT_STALE: +return CACHE_LOOKUP_HIT_STALE; + case TS_CACHE_LOOKUP_HIT_FRESH: +return CACHE_LOOKUP_HIT_FRESH; + case TS_CACHE_LOOKUP_SKIPPED: +return CACHE_LOOKUP_SKIPED; + default: +return CACHE_LOOKUP_NONE; + } +} + void Transaction::redirectTo(std::string const &url) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/523b4749/lib/atscppapi/src/include/atscppapi/Transaction.h -- diff --git a/lib/atscppapi/src/include/atscppapi/Transaction.h b/lib/atscppapi/src/include/atscppapi/Transaction.h index a0d7bf7..39454b0 100644 --- a/lib/atscppapi/src/include/atscppapi/Transaction.h +++ b/lib/atscppapi/src/include/atscppapi/Transaction.h @@ -255,6 +255,19 @@ public: void setTimeout(TimeoutType type, int time_ms); /** + * Represents different states of an object served out of the cache + */ + enum CacheStatus { +CACHE_LOOKUP_MISS = 0, /**< The object was not found in the cache */ +CACHE_LOOKUP_HIT_STALE, /**< The object was found in cache but stale */ +CACHE_LOOKUP_HIT_FRESH, /**< The object was found in cache and was fresh */ +CACHE_LOOKUP_SKIPED,/**< Cache lookup was not performed */ +CACHE_LOOKUP_NONE + }; + + CacheStatus getCacheStatus(); + + /** * Returns the TSHttpTxn related to the current Transaction * * @return a void * which can be cast back to a TSHttpTxn.
trafficserver git commit: TS-3558: Auth Server Session Private: Fix enum order
Repository: trafficserver Updated Branches: refs/heads/master 62d391db9 -> 7ea121ceb TS-3558: Auth Server Session Private: Fix enum order Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7ea121ce Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7ea121ce Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7ea121ce Branch: refs/heads/master Commit: 7ea121ceb3ba7e50fb59929bf39fb7eaf69d13b4 Parents: 62d391d Author: Brian Geffon Authored: Mon Apr 27 19:59:12 2015 -0700 Committer: Brian Geffon Committed: Mon Apr 27 19:59:12 2015 -0700 -- lib/ts/apidefs.h.in | 2 +- proxy/InkAPITest.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7ea121ce/lib/ts/apidefs.h.in -- diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in index a3e0d93..04f4dd9 100644 --- a/lib/ts/apidefs.h.in +++ b/lib/ts/apidefs.h.in @@ -679,7 +679,6 @@ extern "C" TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN, TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT, TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT, -TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE, TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS, // DEPRECATED TS_CONFIG_HTTP_SERVER_SESSION_SHARING_POOL, TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH, @@ -758,6 +757,7 @@ extern "C" TS_CONFIG_HTTP_CACHE_RANGE_WRITE, TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED, TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER, +TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE, TS_CONFIG_LAST_ENTRY } TSOverridableConfigKey; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7ea121ce/proxy/InkAPITest.cc -- diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc index 8a7ec68..6cac306 100644 --- a/proxy/InkAPITest.cc +++ b/proxy/InkAPITest.cc @@ -7170,7 +7170,6 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = { "proxy.config.url_remap.pristine_host_hdr", "proxy.config.http.chunking_enabled", "proxy.config.http.negative_caching_enabled", "proxy.config.http.negative_caching_lifetime", "proxy.config.http.cache.when_to_revalidate", "proxy.config.http.keep_alive_enabled_in", "proxy.config.http.keep_alive_enabled_out", "proxy.config.http.keep_alive_post_out", - "proxy.config.http.auth_server_session_private", "proxy.config.http.share_server_sessions", "proxy.config.http.server_session_sharing.pool", "proxy.config.http.server_session_sharing.match", "proxy.config.net.sock_recv_buffer_size_out", "proxy.config.net.sock_send_buffer_size_out", "proxy.config.net.sock_option_flag_out", @@ -7207,6 +7206,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = { "proxy.config.ssl.hsts_max_age", "proxy.config.ssl.hsts_include_subdomains", "proxy.config.http.cache.open_read_retry_time", "proxy.config.http.cache.max_open_read_retries", "proxy.config.http.cache.range.write", "proxy.config.http.post.check.content_length.enabled", "proxy.config.http.global_user_agent_header", + "proxy.config.http.auth_server_session_private" }; REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* atype ATS_UNUSED */, int *pstatus)
[1/3] trafficserver git commit: TS-3558: Update Docs
Repository: trafficserver Updated Branches: refs/heads/master e709f7c08 -> 62d391db9 TS-3558: Update Docs Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a1af594d Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a1af594d Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a1af594d Branch: refs/heads/master Commit: a1af594d99019df93a647d31b397dfc60bab7e05 Parents: e709f7c Author: Brian Geffon Authored: Mon Apr 27 19:53:40 2015 -0700 Committer: Brian Geffon Committed: Mon Apr 27 19:53:40 2015 -0700 -- doc/reference/configuration/records.config.en.rst | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a1af594d/doc/reference/configuration/records.config.en.rst -- diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst index b218011..685a092 100644 --- a/doc/reference/configuration/records.config.en.rst +++ b/doc/reference/configuration/records.config.en.rst @@ -728,6 +728,12 @@ Value Effect Note that setting this parameter to (``2``) will not work correctly unless the dedicated SSL threads are disabled (:ts:cv:`proxy.config.ssl.number.threads` is set to (``-1``)). + +.. ts:cv:: CONFIG proxy.config.http.auth_server_session_private INT 1 + + If enabled (``1``) anytime a request contains a (``Authorization``), (``Proxy-Authorization``) + or (``Www-Authenticate``) header the connection will be closed and not reused. This marks + the connection as private. When disabled (``0``) the connection will be available for reuse. .. ts:cv:: CONFIG proxy.config.http.server_session_sharing.match STRING both
[3/3] trafficserver git commit: TS-3558: Update Changes
TS-3558: Update Changes Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/62d391db Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/62d391db Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/62d391db Branch: refs/heads/master Commit: 62d391db901a2eff87ea1a03bf966d19d4ac37be Parents: 300cdba Author: Brian Geffon Authored: Mon Apr 27 19:55:05 2015 -0700 Committer: Brian Geffon Committed: Mon Apr 27 19:55:05 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/62d391db/CHANGES -- diff --git a/CHANGES b/CHANGES index 7a81370..3ddf51b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 6.0.0 + *) [TS-3558] Fix proxy.config.http.auth_server_session_private + *) [TS-3552] Move the check for the api_server_response_no_store flag earlier.
[2/3] trafficserver git commit: TS-3558: Fix proxy.config.http.auth_server_session_private
TS-3558: Fix proxy.config.http.auth_server_session_private Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/300cdbae Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/300cdbae Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/300cdbae Branch: refs/heads/master Commit: 300cdbae992eb21d5cca233e91467f7902b726d8 Parents: a1af594 Author: Brian Geffon Authored: Mon Apr 27 19:54:41 2015 -0700 Committer: Brian Geffon Committed: Mon Apr 27 19:54:41 2015 -0700 -- lib/ts/apidefs.h.in | 1 + proxy/InkAPI.cc | 7 +++ proxy/InkAPITest.cc | 1 + proxy/http/HttpConfig.cc | 4 proxy/http/HttpSM.cc | 46 --- proxy/http/HttpSM.h | 7 +++ 6 files changed, 50 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/300cdbae/lib/ts/apidefs.h.in -- diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in index 329adf2..a3e0d93 100644 --- a/lib/ts/apidefs.h.in +++ b/lib/ts/apidefs.h.in @@ -679,6 +679,7 @@ extern "C" TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_IN, TS_CONFIG_HTTP_KEEP_ALIVE_ENABLED_OUT, TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT, +TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE, TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS, // DEPRECATED TS_CONFIG_HTTP_SERVER_SESSION_SHARING_POOL, TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH, http://git-wip-us.apache.org/repos/asf/trafficserver/blob/300cdbae/proxy/InkAPI.cc -- diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc index 55def42..cfc1411 100644 --- a/proxy/InkAPI.cc +++ b/proxy/InkAPI.cc @@ -7660,6 +7660,9 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr case TS_CONFIG_HTTP_KEEP_ALIVE_POST_OUT: ret = &overridableHttpConfig->keep_alive_post_out; break; + case TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE: +ret = &overridableHttpConfig->auth_server_session_private; +break; case TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS: ink_assert("Deprecated config key value - TS_CONFIG_HTTP_SHARE_SERVER_SESSIONS"); //ret = &overridableHttpConfig->share_server_sessions; @@ -8438,6 +8441,10 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf, if (0 == strncmp(name, "proxy.config.http.server_session_sharing.pool", length)) cnf = TS_CONFIG_HTTP_SERVER_SESSION_SHARING_POOL; break; +case 'e': + if (0 == strncmp(name, "proxy.config.http.auth_server_session_private", length)) +cnf = TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE; + break; } break; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/300cdbae/proxy/InkAPITest.cc -- diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc index de5e319..8a7ec68 100644 --- a/proxy/InkAPITest.cc +++ b/proxy/InkAPITest.cc @@ -7170,6 +7170,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = { "proxy.config.url_remap.pristine_host_hdr", "proxy.config.http.chunking_enabled", "proxy.config.http.negative_caching_enabled", "proxy.config.http.negative_caching_lifetime", "proxy.config.http.cache.when_to_revalidate", "proxy.config.http.keep_alive_enabled_in", "proxy.config.http.keep_alive_enabled_out", "proxy.config.http.keep_alive_post_out", + "proxy.config.http.auth_server_session_private", "proxy.config.http.share_server_sessions", "proxy.config.http.server_session_sharing.pool", "proxy.config.http.server_session_sharing.match", "proxy.config.net.sock_recv_buffer_size_out", "proxy.config.net.sock_send_buffer_size_out", "proxy.config.net.sock_option_flag_out", http://git-wip-us.apache.org/repos/asf/trafficserver/blob/300cdbae/proxy/http/HttpConfig.cc -- diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index a5bfc63..50d0b45 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -987,6 +987,8 @@ HttpConfig::startup() http_config_enum_read("proxy.config.http.server_session_sharing.match", SessionSharingMatchStrings, c.oride.server_session_sharing_match); + HttpEstablishStaticConfigByte(c.oride.auth_server_session_private, "proxy.config.http.auth_server_session_private"); + HttpEstablishStaticConfigByte(c.oride.keep_alive_post_out, "proxy.config.http.keep_alive_post_out"); HttpEstablishStaticConfigLongLong(c.oride.keep_alive_no_activity_timeout_in, @@ -1232,6 +1234,8 @@ HttpConfig::reconfigure() params->oride.keep_alive_enabled_in = INT_TO_BOOL(m_ma
[3/3] trafficserver git commit: TS-3459: Create a new config to disallow Post w/ Expect: 100-continue: UPDATE CHANGES
TS-3459: Create a new config to disallow Post w/ Expect: 100-continue: UPDATE CHANGES Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/95cd99da Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/95cd99da Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/95cd99da Branch: refs/heads/master Commit: 95cd99da5d161fc2419584a0e40329f48e55e732 Parents: bf207f3 Author: Brian Geffon Authored: Fri Mar 20 09:49:06 2015 -0700 Committer: Brian Geffon Committed: Fri Mar 20 09:49:06 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/95cd99da/CHANGES -- diff --git a/CHANGES b/CHANGES index 538f704..696c6ff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.3.0 + *) [TS-3459] Create a new config to disallow Post w/ Expect: 100-continue + *) [TS-3312] KA timeout to origin does not honor configs *) [TS-3437] A null dhParams file will disable DHE.
[2/3] trafficserver git commit: TS-3459: Create a new config to disallow Post w/ Expect: 100-continue: UPDATE DOCS
TS-3459: Create a new config to disallow Post w/ Expect: 100-continue: UPDATE DOCS Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/bf207f3a Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/bf207f3a Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/bf207f3a Branch: refs/heads/master Commit: bf207f3a361d69c9cf1c0f60aec377ee8ebe195d Parents: a30afc0 Author: Brian Geffon Authored: Fri Mar 20 09:48:54 2015 -0700 Committer: Brian Geffon Committed: Fri Mar 20 09:48:54 2015 -0700 -- doc/reference/configuration/records.config.en.rst | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bf207f3a/doc/reference/configuration/records.config.en.rst -- diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst index 4cad8e8..b503a0e 100644 --- a/doc/reference/configuration/records.config.en.rst +++ b/doc/reference/configuration/records.config.en.rst @@ -871,6 +871,14 @@ specific domains. Controls wether POST timeout sends a HTTP status 408 response (``1``) +.. ts:cv:: CONFIG proxy.config.http.disallow_post_100_continue INT 0 + + Allows you to return a 405 Method Not Supported with Posts also + containing an Expect: 100-continue. + + When a Post w/ Expect: 100-continue is blocked the stat + proxy.process.http.disallowed_post_100_continue will be incremented. + Parent Proxy Configuration ==
[1/3] trafficserver git commit: TS-3459: Create a new config to disallow Post w/ Expect: 100-continue
Repository: trafficserver Updated Branches: refs/heads/master e26aeb9cb -> 95cd99da5 TS-3459: Create a new config to disallow Post w/ Expect: 100-continue Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a30afc0c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a30afc0c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a30afc0c Branch: refs/heads/master Commit: a30afc0c8b97d5427797f2a53a0b7e89f186f5f3 Parents: e26aeb9 Author: Brian Geffon Authored: Fri Mar 20 09:45:13 2015 -0700 Committer: Brian Geffon Committed: Fri Mar 20 09:45:13 2015 -0700 -- mgmt/RecordsConfig.cc | 2 ++ proxy/http/HttpConfig.cc | 6 ++ proxy/http/HttpConfig.h| 5 - proxy/http/HttpTransact.cc | 18 ++ 4 files changed, 30 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a30afc0c/mgmt/RecordsConfig.cc -- diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 03a32ec..c9212eb 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -440,6 +440,8 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.send_408_post_timeout_response", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL} , + {RECT_CONFIG, "proxy.config.http.disallow_post_100_continue", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL} + , {RECT_CONFIG, "proxy.config.http.share_server_sessions", RECD_INT, "2", RECU_RESTART_TS, RR_NULL, RECC_NULL, NULL, RECA_NULL} , {RECT_CONFIG, "proxy.config.http.server_session_sharing.match", RECD_STRING, "both", RECU_RESTART_TS, RR_NULL, RECC_NULL, NULL, RECA_NULL} http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a30afc0c/proxy/http/HttpConfig.cc -- diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index ab560d3..b57795e 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -1081,6 +1081,10 @@ register_stat_callbacks() (int) http_ua_msecs_counts_other_unclassified_stat, RecRawStatSyncIntMsecsToFloatSeconds); RecRegisterRawStat(http_rsb, RECT_PROCESS, + "proxy.process.http.disallowed_post_100_continue", + RECD_COUNTER, RECP_PERSISTENT, (int) disallowed_post_100_continue, RecRawStatSyncCount); + + RecRegisterRawStat(http_rsb, RECT_PROCESS, "proxy.process.http.total_x_redirect_count", RECD_COUNTER, RECP_PERSISTENT, (int) http_total_x_redirect_stat, RecRawStatSyncCount); @@ -1289,6 +1293,7 @@ HttpConfig::startup() HttpEstablishStaticConfigByte(c.send_100_continue_response, "proxy.config.http.send_100_continue_response"); HttpEstablishStaticConfigByte(c.send_408_post_timeout_response, "proxy.config.http.send_408_post_timeout_response"); + HttpEstablishStaticConfigByte(c.disallow_post_100_continue, "proxy.config.http.disallow_post_100_continue"); HttpEstablishStaticConfigByte(c.parser_allow_non_http, "proxy.config.http.parse.allow_non_http"); HttpEstablishStaticConfigByte(c.oride.cache_when_to_revalidate, "proxy.config.http.cache.when_to_revalidate"); @@ -1547,6 +1552,7 @@ HttpConfig::reconfigure() params->send_100_continue_response = INT_TO_BOOL(m_master.send_100_continue_response); params->send_408_post_timeout_response = INT_TO_BOOL(m_master.send_408_post_timeout_response); + params->disallow_post_100_continue = INT_TO_BOOL(m_master.disallow_post_100_continue); params->parser_allow_non_http = INT_TO_BOOL(m_master.parser_allow_non_http); params->oride.cache_when_to_revalidate = m_master.oride.cache_when_to_revalidate; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a30afc0c/proxy/http/HttpConfig.h -- diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h index 9722144..8f678d5 100644 --- a/proxy/http/HttpConfig.h +++ b/proxy/http/HttpConfig.h @@ -228,6 +228,8 @@ enum http_ua_msecs_counts_errors_other_stat, http_ua_msecs_counts_other_unclassified_stat, + disallowed_post_100_continue, + http_total_x_redirect_stat, // Times @@ -733,6 +735,7 @@ public: MgmtByte send_100_continue_response; MgmtByte send_408_post_timeout_response; + MgmtByte disallow_post_100_continue; MgmtByte parser_allow_non_http; OverridableHttpConfigParams oride; @@ -743,7 +746,6 @@ public: MgmtInt autoconf_port; MgmtByte autoconf_localhost_only; - private: / // operator = and copy constructor // @@ -889,6 +891,7 @@ HttpCon
[2/2] trafficserver git commit: TS-3312: Update Changes
TS-3312: Update Changes Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e26aeb9c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e26aeb9c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e26aeb9c Branch: refs/heads/master Commit: e26aeb9cb69d1c301cf0629fc8293ec4090212e5 Parents: 88c1257 Author: Brian Geffon Authored: Thu Mar 19 16:45:57 2015 -0700 Committer: Brian Geffon Committed: Thu Mar 19 16:45:57 2015 -0700 -- CHANGES | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e26aeb9c/CHANGES -- diff --git a/CHANGES b/CHANGES index 00127c3..538f704 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.3.0 + *) [TS-3312] KA timeout to origin does not honor configs + *) [TS-3437] A null dhParams file will disable DHE. *) [TS-3454] add support for dscp and milestone api for lua plugin.