Repository: trafficserver
Updated Branches:
  refs/heads/master 3d721ea9d -> 57a53649a


TS-3456: SSL blind tunnel sometime not created.


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

Branch: refs/heads/master
Commit: 57a53649acfbc7b1cb3d828f47457aad335936bd
Parents: 3d721ea
Author: Lev Stipakov <lstipa...@gmail.com>
Authored: Mon Mar 30 10:03:49 2015 -0500
Committer: shinrich <shinr...@yahoo-inc.com>
Committed: Mon Mar 30 10:03:49 2015 -0500

----------------------------------------------------------------------
 CHANGES         |  2 ++
 proxy/InkAPI.cc | 24 +++++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/57a53649/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index c15855e..c2c6b03 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,8 @@ Changes with Apache Traffic Server 6.0.0
 
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3456] SSL blind tunnel sometimes not created.
+
   *) [TS-2709] ATS does not send close-notify on shutdown. Confuses some 
clients.
 
   *) [TS-3467] Cleanup tmp files created from traffic_via tests.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/57a53649/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 6c73d16..73b9c1e 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -8787,16 +8787,22 @@ TSVConnReenable(TSVConn vconn)
   // We really only deal with a SSLNetVConnection at the moment
   if (ssl_vc != NULL) {
     EThread *eth = this_ethread();
-
-    // We use the VC mutex so we don't need to reschedule again if we
-    // can't get the lock. For this reason we need to execute the
-    // callback on the VC thread or it doesn't work (not sure why -
-    // deadlock or it ends up interacting with the wrong NetHandler).
-    MUTEX_TRY_LOCK(trylock, ssl_vc->mutex, eth);
-    if (!trylock.is_locked()) {
+    bool reschedule = eth != ssl_vc->thread;
+
+    if (!reschedule) { 
+      // We use the VC mutex so we don't need to reschedule again if we
+      // can't get the lock. For this reason we need to execute the
+      // callback on the VC thread or it doesn't work (not sure why -
+      // deadlock or it ends up interacting with the wrong NetHandler).
+      MUTEX_TRY_LOCK(trylock, ssl_vc->mutex, eth);
+      if (trylock.is_locked()) {
+        ssl_vc->reenable(ssl_vc->nh);
+      } else {
+        reschedule = true;
+      }
+    }
+    if (reschedule) {
       ssl_vc->thread->schedule_imm(new TSSslCallback(ssl_vc));
-    } else {
-      ssl_vc->reenable(ssl_vc->nh);
     }
   }
 }

Reply via email to