trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject [trafficserver] branch master updated: Fix crashes from early post return fix.
Date Mon, 09 Jul 2018 22:56:08 GMT
This is an automated email from the ASF dual-hosted git repository.

shinrich 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 c243788  Fix crashes from early post return fix.
c243788 is described below

commit c24378848ca8d083aacd69b6365ab65f291e8149
Author: Susan Hinrichs <shinrich@apache.org>
AuthorDate: Tue Jul 3 16:11:45 2018 -0500

    Fix crashes from early post return fix.
---
 proxy/http/HttpSM.cc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 6e4167b..297275e 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1812,6 +1812,11 @@ HttpSM::state_read_server_response_header(int event, void *data)
   case VC_EVENT_READ_READY:
   case VC_EVENT_READ_COMPLETE:
     // More data to parse
+
+    // If there is still a post body underway, defer processing until post body is done
+    if (ua_entry->in_tunnel && !server_entry->eos) {
+      return 0;
+    }
     break;
 
   case VC_EVENT_ERROR:
@@ -2687,6 +2692,10 @@ HttpSM::tunnel_handler_post(int event, void *data)
     handle_post_failure();
     break;
   case HTTP_SM_POST_UA_FAIL:
+    // Cancel out the server read if present. Left over attempt to read server response.
+    if (server_entry && server_entry->read_vio && server_session &&
server_entry->read_vio->cont) {
+      server_entry->read_vio = server_session->do_io_read(nullptr, 0, nullptr);
+    }
     break;
   case HTTP_SM_POST_SUCCESS:
     // It's time to start reading the response
@@ -2698,7 +2707,11 @@ HttpSM::tunnel_handler_post(int event, void *data)
       call_transact_and_set_next_state(HttpTransact::HandleRequestBufferDone);
       break;
     }
-    // Read reasponse already setup
+    // Read response already setup
+    // Signal if data is waiting
+    if (server_entry->read_vio && server_entry->read_vio->ndone > 0)
{
+      handleEvent(VC_EVENT_READ_READY, server_entry->read_vio);
+    }
     break;
   default:
     ink_release_assert(0);


Mime
View raw message