trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject [05/17] git commit: Fix internal half closed post bug
Date Wed, 18 Jun 2014 23:51:31 GMT
Fix internal half closed post bug


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

Branch: refs/heads/4.2.x
Commit: 0e1bb48da286ecd82b80cf6311dbd1b09f06afeb
Parents: d1cf2b2
Author: Brian Geffon <briang@apache.org>
Authored: Mon Jun 9 16:44:04 2014 -0700
Committer: Brian Geffon <briang@apache.org>
Committed: Tue Jun 10 15:57:00 2014 -0700

----------------------------------------------------------------------
 proxy/http/HttpSM.cc | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0e1bb48d/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 8618728..66e6d6c 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -3143,10 +3143,19 @@ HttpSM::tunnel_handler_ua(int event, HttpTunnelConsumer * c)
   if (close_connection) {
     // If the client could be pipelining or is doing a POST, we need to
     //   set the ua_session into half close mode
-    if ((t_state.method == HTTP_WKSIDX_POST || t_state.client_info.pipeline_possible == true)
-        && event == VC_EVENT_WRITE_COMPLETE) {
-      ua_session->set_half_close_flag();
-    }
+
+	  // only external POSTs should be subject to this logic; ruling out internal POSTs here
+	  bool is_eligible_post_request = (t_state.method == HTTP_WKSIDX_POST);
+	  if (is_eligible_post_request) {
+	   NetVConnection *vc = ua_session->get_netvc();
+	   if (vc) {
+		  is_eligible_post_request = vc->get_is_internal_request() ? false : true;
+	   }
+	  }
+	  if ((is_eligible_post_request || t_state.client_info.pipeline_possible == true) &&
+			  event == VC_EVENT_WRITE_COMPLETE) {
+		  ua_session->set_half_close_flag();
+	  }
 
     ua_session->do_io_close();
     ua_session = NULL;


Mime
View raw message