Repository: trafficserver
Updated Branches:
  refs/heads/master 97884c8ef -> e5ac376b9


TS-3343 outbound transparent can end up with Connection: keep-alive headers
on failures

Revised to check for NULL ua_session and restrict new behavior to specific
status codes.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e5ac376b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e5ac376b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e5ac376b

Branch: refs/heads/master
Commit: e5ac376b91ef2ac5aff4c87d0b33f9d3c6aa0637
Parents: 97884c8
Author: William Bardwell <[email protected]>
Authored: Fri Jan 30 11:40:37 2015 -0500
Committer: William Bardwell <[email protected]>
Committed: Fri Jan 30 13:09:33 2015 -0500

----------------------------------------------------------------------
 CHANGES                    |  2 ++
 proxy/InkAPI.cc            |  4 ----
 proxy/http/HttpTransact.cc | 10 ++++++++++
 3 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5ac376b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 7602c0a..bbc302f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3343] outbound transparent can end up with Connection: keep-alive hea
+
   *) [TS-3351] Add basic pkg-config support.
 
   *) [TS-3349] Add DscpSet API's.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5ac376b/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 9c9f32f..efd6572 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -5340,10 +5340,6 @@ TSHttpTxnOutgoingTransparencySet(TSHttpTxn txnp, int 
flag)
 {
   if (TS_SUCCESS != sdk_sanity_check_txn(txnp)) return TS_ERROR;
 
-# if ! TS_USE_TPROXY
-  if (flag) return TS_ERROR; // can't enable if it's not configured.
-# endif
-
   HttpSM *sm = reinterpret_cast<HttpSM*>(txnp);
   if (NULL == sm || NULL == sm->ua_session) {
     return TS_ERROR;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e5ac376b/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 7189ed2..7cc6bec 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7934,6 +7934,16 @@ HttpTransact::build_error_response(State *s, HTTPStatus 
status_code, const char
     //  the content-length
     s->hdr_info.trust_response_cl = true;
   }
+  // If transparent and the forward server connection looks unhappy don't
+  // keep alive the ua connection.
+  if ((s->state_machine->ua_session &&
+       s->state_machine->ua_session->f_outbound_transparent) &&
+      (status_code == HTTP_STATUS_INTERNAL_SERVER_ERROR ||
+       status_code == HTTP_STATUS_GATEWAY_TIMEOUT ||
+       status_code == HTTP_STATUS_BAD_GATEWAY ||
+       status_code == HTTP_STATUS_SERVICE_UNAVAILABLE)) {
+    s->client_info.keep_alive = HTTP_NO_KEEPALIVE;
+  }
 
   switch (status_code) {
   case HTTP_STATUS_BAD_REQUEST:

Reply via email to