trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch 7.1.x updated: Clear vio so lingering IO is not confused when error message is returned
Date Wed, 14 Mar 2018 21:21:34 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new fb5c95a  Clear vio so lingering IO is not confused when error message is returned
fb5c95a is described below

commit fb5c95a166e2018fb6c25afb8ee659f3a51451c3
Author: Susan Hinrichs <shinrich@apache.org>
AuthorDate: Mon Mar 12 15:31:13 2018 -0500

    Clear vio so lingering IO is not confused when error message is returned
    
    Addresses issue #3239
    
    (cherry picked from commit a22f2c782690de8bde3fcd07267cce5f10aca26b)
    
     Conflicts:
    	iocore/cache/Cache.cc
---
 iocore/cache/Cache.cc    | 8 ++++----
 proxy/http/HttpTunnel.cc | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index ad08f8f..6a85b42 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -328,9 +328,9 @@ CacheVC::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *abuf)
   vio.nbytes    = nbytes;
   vio.vc_server = this;
 #ifdef DEBUG
-  ink_assert(c->mutex->thread_holding);
+  ink_assert(!c || c->mutex->thread_holding);
 #endif
-  if (!trigger && !recursive)
+  if (c && !trigger && !recursive)
     trigger = c->mutex->thread_holding->schedule_imm_local(this);
   return &vio;
 }
@@ -364,9 +364,9 @@ CacheVC::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuf,
bool
   vio.nbytes    = nbytes;
   vio.vc_server = this;
 #ifdef DEBUG
-  ink_assert(c->mutex->thread_holding);
+  ink_assert(!c || c->mutex->thread_holding);
 #endif
-  if (!trigger && !recursive)
+  if (c && !trigger && !recursive)
     trigger = c->mutex->thread_holding->schedule_imm_local(this);
   return &vio;
 }
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index 403c6fd..aa5d1a0 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -1255,6 +1255,9 @@ HttpTunnel::producer_handler(int event, HttpTunnelProducer *p)
     if (p->alive) {
       p->alive      = false;
       p->bytes_read = p->read_vio->ndone;
+      // Clear any outstanding reads so they don't
+      // collide with future tunnel IO's
+      p->vc->do_io_read(nullptr, 0, 0);
       // Interesting tunnel event, call SM
       jump_point = p->vc_handler;
       (sm->*jump_point)(event, p);

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.

Mime
View raw message