You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by vg...@apache.org on 2020/05/15 08:08:23 UTC
[trafficserver] branch master updated: Use Proxy-Connection iff
parent_is_proxy=true
This is an automated email from the ASF dual-hosted git repository.
vgutierrez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new ebc4314 Use Proxy-Connection iff parent_is_proxy=true
ebc4314 is described below
commit ebc431431f4a13ac7e661a168c42a3b81c0176d9
Author: Valentin Gutierrez <vg...@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
---
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 a41e389..d985b00 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6844,7 +6844,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);
@@ -6858,7 +6858,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);