This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/8.0.x by this push:
new 40f330a Revert "Remove the ignore_keep_alive method entirely"
40f330a is described below
commit 40f330a53174b2481e2ea4c8a2cc9c12d5002371
Author: Leif Hedstrom <[email protected]>
AuthorDate: Mon Mar 30 11:17:09 2020 -0600
Revert "Remove the ignore_keep_alive method entirely"
This reverts commit 4cdb42b4b2cf175c3eb0ff4f567a3394ce37ff66.
Oops, prematurely CP'ed this, reverting for now.
---
proxy/ProxyClientTransaction.h | 6 ++++++
proxy/http/Http1ClientTransaction.h | 6 ++++++
proxy/http/HttpTransact.cc | 2 +-
proxy/http2/Http2Stream.h | 7 +++++++
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/proxy/ProxyClientTransaction.h b/proxy/ProxyClientTransaction.h
index 86f7b65..12fcf30 100644
--- a/proxy/ProxyClientTransaction.h
+++ b/proxy/ProxyClientTransaction.h
@@ -196,6 +196,12 @@ public:
{
}
+ virtual bool
+ ignore_keep_alive()
+ {
+ return true;
+ }
+
virtual void destroy();
virtual void transaction_done() = 0;
diff --git a/proxy/http/Http1ClientTransaction.h
b/proxy/http/Http1ClientTransaction.h
index 8a87666..0251b2c 100644
--- a/proxy/http/Http1ClientTransaction.h
+++ b/proxy/http/Http1ClientTransaction.h
@@ -81,6 +81,12 @@ public:
void release(IOBufferReader *r) override;
+ bool
+ ignore_keep_alive() override
+ {
+ return false;
+ }
+
bool allow_half_open() const override;
void set_parent(ProxyClientSession *new_parent) override;
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 0a7d710..5629521 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5451,7 +5451,7 @@
HttpTransact::initialize_state_variables_from_request(State *s, HTTPHdr *obsolet
}
// If this is an internal request, never keep alive
- if (!s->txn_conf->keep_alive_enabled_in) {
+ if (!s->txn_conf->keep_alive_enabled_in || (s->state_machine->ua_txn &&
s->state_machine->ua_txn->ignore_keep_alive())) {
s->client_info.keep_alive = HTTP_NO_KEEPALIVE;
} else if (vc && vc->get_is_internal_request()) {
// Following the trail of JIRAs back from TS-4960, there can be issues with
diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h
index 68099d2..3be1057 100644
--- a/proxy/http2/Http2Stream.h
+++ b/proxy/http2/Http2Stream.h
@@ -142,6 +142,13 @@ public:
void signal_write_event(bool call_update);
void reenable(VIO *vio) override;
void transaction_done() override;
+ bool
+ ignore_keep_alive() override
+ {
+ // If we return true here, Connection header will always be "close".
+ // It should be handled as the same as HTTP/1.1
+ return false;
+ }
void restart_sending();
void push_promise(URL &url, const MIMEField *accept_encoding);