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:40:59 UTC
[trafficserver] 02/02: 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.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 4343d2dd13f785f39353be8f824bec374320006c
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 106da00..0674f35 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 && 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);
@@ -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 && 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);