You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/03/01 17:20:12 UTC

[trafficserver] branch 9.1.x updated: Fix KA header not checking strategy (#7483)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.1.x by this push:
     new 7b5267a  Fix KA header not checking strategy (#7483)
7b5267a is described below

commit 7b5267a71a5ba4b1234ec7b5761c49d42a8d7d87
Author: Robert O Butts <ro...@users.noreply.github.com>
AuthorDate: Thu Feb 25 16:01:45 2021 -0700

    Fix KA header not checking strategy (#7483)
    
    Fixes handle_request_keep_alive_headers directly checking the old
    parentage for parent_is_proxy, instead of the abstract func which
    checks the strategy if it exists.
    
    This would cause the Connection header to get added instead of the
    correct Proxy-Connection when Strategies are used.
    
    (cherry picked from commit e24c79a4a530dc9b12880503e8c047e5610c3224)
---
 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 3669169..a8bfd23 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6761,7 +6761,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 && s->parent_result.parent_is_proxy()) {
+        if (s->current.request_to == PARENT_PROXY && parent_is_proxy(s)) {
           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);
@@ -6775,7 +6775,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 && s->parent_result.parent_is_proxy()) {
+        if (s->current.request_to == PARENT_PROXY && parent_is_proxy(s)) {
           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);