You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2015/08/24 17:52:36 UTC

trafficserver git commit: TS-3777: TSHttpConnect and POST request does not fire TS_VCONN_READ_COMPLETE nor TS_VCONN_EOS.

Repository: trafficserver
Updated Branches:
  refs/heads/master 253c55a1c -> 1c81f16c9


TS-3777: TSHttpConnect and POST request does not fire TS_VCONN_READ_COMPLETE nor TS_VCONN_EOS.


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

Branch: refs/heads/master
Commit: 1c81f16c997d081ecf18ecb13b9f412d55e6ff81
Parents: 253c55a
Author: shinrich <sh...@yahoo-inc.com>
Authored: Mon Aug 24 10:49:45 2015 -0500
Committer: shinrich <sh...@yahoo-inc.com>
Committed: Mon Aug 24 10:52:05 2015 -0500

----------------------------------------------------------------------
 proxy/http/HttpSM.cc       | 8 +++++---
 proxy/http/HttpTransact.cc | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1c81f16c/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 5ed3de0..2fab41c 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -844,7 +844,9 @@ HttpSM::state_watch_for_client_abort(int event, void *data)
    * client.
    */
   case VC_EVENT_EOS:
-    static_cast<HttpClientSession *>(ua_entry->vc)->get_netvc()->do_io_shutdown(IO_SHUTDOWN_READ);
+    // We got an early EOS.
+    ua_session->get_netvc()->do_io_shutdown(IO_SHUTDOWN_READ);
+    ua_entry->eos = true;
     break;
   case VC_EVENT_ERROR:
   case VC_EVENT_ACTIVE_TIMEOUT:
@@ -2920,7 +2922,7 @@ HttpSM::tunnel_handler_server(int event, HttpTunnelProducer *p)
     //
     // The transfer completed successfully
     //    If there is still data in the buffer, the server
-    //    sent to much indicating a failed transfer
+    //    sent too much indicating a failed transfer
     p->read_success = true;
     t_state.current.server->state = HttpTransact::TRANSACTION_COMPLETE;
     t_state.current.server->abort = HttpTransact::DIDNOT_ABORT;
@@ -3189,7 +3191,7 @@ HttpSM::tunnel_handler_ua(int event, HttpTunnelConsumer *c)
     if (is_eligible_post_request) {
       NetVConnection *vc = ua_session->get_netvc();
       if (vc) {
-        is_eligible_post_request = vc->get_is_internal_request() ? false : true;
+        is_eligible_post_request &= !vc->get_is_internal_request();
       }
     }
     if ((is_eligible_post_request || t_state.client_info.pipeline_possible == true) && c->producer->vc_type != HT_STATIC &&

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1c81f16c/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 15a3cd6..b2e75ca 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5583,7 +5583,9 @@ HttpTransact::initialize_state_variables_from_request(State *s, HTTPHdr *obsolet
     s->client_info.proxy_connect_hdr = true;
   }
 
-  if (!s->txn_conf->keep_alive_enabled_in) {
+  // If this is an internal request, never keep alive
+  NetVConnection *vc = s->state_machine->ua_session->get_netvc();
+  if (!s->txn_conf->keep_alive_enabled_in || (vc && vc->get_is_internal_request())) {
     s->client_info.keep_alive = HTTP_NO_KEEPALIVE;
   } else {
     s->client_info.keep_alive = incoming_request->keep_alive_get();