trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] 01/02: Use Proxy-Connection iff parent_is_proxy=true
Date Mon, 01 Mar 2021 17:40:58 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 20388c277319006973c7a01fcf4d25df80a7f31e
Author: Valentin Gutierrez <vgutierrez@wikimedia.org>
AuthorDate: Thu May 14 16:11:36 2020 +0000

    Use Proxy-Connection iff parent_is_proxy=true
    
    Prior to this change a parent proxy configured as parent_is_proxy=false
    would get Proxy-Connection: keep-alive|close instead of
    Connection: keep-alive|close
    
    (cherry picked from commit ebc431431f4a13ac7e661a168c42a3b81c0176d9)
---
 proxy/http/HttpTransact.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index eff9c3b..106da00 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6890,7 +6890,7 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion
ver, HTTPH
     case KA_CONNECTION:
       ink_assert(s->current.server->keep_alive != HTTP_NO_KEEPALIVE);
       if (ver == HTTPVersion(1, 0)) {
-        if (s->current.request_to == PARENT_PROXY) {
+        if (s->current.request_to == PARENT_PROXY && s->parent_result.parent_is_proxy())
{
           heads->value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "keep-alive",
10);
         } else {
           heads->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "keep-alive", 10);
@@ -6904,7 +6904,7 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion
ver, HTTPH
       if (s->current.server->keep_alive != HTTP_NO_KEEPALIVE || (ver == HTTPVersion(1,
1))) {
         /* Had keep-alive */
         s->current.server->keep_alive = HTTP_NO_KEEPALIVE;
-        if (s->current.request_to == PARENT_PROXY) {
+        if (s->current.request_to == PARENT_PROXY && s->parent_result.parent_is_proxy())
{
           heads->value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "close",
5);
         } else {
           heads->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "close", 5);


Mime
View raw message