Repository: trafficserver Updated Branches: refs/heads/master baa615072 -> ee5debcf5
TS-4327: Fix bug introduced with the addition of multi-site origin to parent selection. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ee5debcf Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ee5debcf Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ee5debcf Branch: refs/heads/master Commit: ee5debcf55f4014a07d285f7d44bb95e0fe82529 Parents: baa6150 Author: John J. Rushford <[email protected]> Authored: Wed Apr 6 19:49:04 2016 +0000 Committer: John J. Rushford <[email protected]> Committed: Wed Apr 6 19:49:04 2016 +0000 ---------------------------------------------------------------------- proxy/http/HttpTransact.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ee5debcf/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 8a1f536..085ebb5 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -210,19 +210,25 @@ find_server_and_update_current_info(HttpTransact::State *s) // I just wanted to do this for cop heartbeats, someone else // wanted it for all requests to local_host. s->parent_result.r = PARENT_DIRECT; - } else if (s->method == HTTP_WKSIDX_CONNECT && s->http_config_param->disable_ssl_parenting && - s->parent_result.rec->parent_is_proxy) { - s->parent_result.r = PARENT_DIRECT; + } else if (s->method == HTTP_WKSIDX_CONNECT && s->http_config_param->disable_ssl_parenting) { + s->parent_params->findParent(&s->request_data, &s->parent_result); + if (s->parent_result.rec == NULL || s->parent_result.rec->parent_is_proxy) { + DebugTxn("http_trans", "request not cacheable, so bypass parent"); + s->parent_result.r = PARENT_DIRECT; + } } else if (s->http_config_param->uncacheable_requests_bypass_parent && s->http_config_param->no_dns_forward_to_parent == 0 && - !HttpTransact::is_request_cache_lookupable(s) && s->parent_result.rec->parent_is_proxy) { + !HttpTransact::is_request_cache_lookupable(s)) { // request not lookupable and cacheable, so bypass parent if the parent is not an origin server. // Note that the configuration of the proxy as well as the request // itself affects the result of is_request_cache_lookupable(); // we are assuming both child and parent have similar configuration // with respect to whether a request is cacheable or not. // For example, the cache_urls_that_look_dynamic variable. - DebugTxn("http_trans", "request not cacheable, so bypass parent"); - s->parent_result.r = PARENT_DIRECT; + s->parent_params->findParent(&s->request_data, &s->parent_result); + if (s->parent_result.rec == NULL || s->parent_result.rec->parent_is_proxy) { + DebugTxn("http_trans", "request not cacheable, so bypass parent"); + s->parent_result.r = PARENT_DIRECT; + } } else { switch (s->parent_result.r) { case PARENT_UNDEFINED:
