You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/03/27 20:16:23 UTC

[trafficserver] 02/02: Fix ssl hook state logic.

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

commit 317738edbcb6622aca949892f416f410c9801388
Author: Susan Hinrichs <sh...@ieee.org>
AuthorDate: Tue Mar 7 19:04:12 2017 +0000

    Fix ssl hook state logic.
    
    Was not correctly resetting the ssl hook state after the servername hooks.
---
 iocore/net/SSLNetVConnection.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 6f2784c..197b5df 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -1465,12 +1465,15 @@ SSLNetVConnection::callHooks(TSEvent eventId)
     this->sslHandshakeHookState = HANDSHAKE_HOOKS_INVOKE;
     curHook->invoke(eventId, this);
     reenabled = eventId != TS_EVENT_SSL_CERT || (this->sslHandshakeHookState != HANDSHAKE_HOOKS_INVOKE);
-  } else {
-    // no SNI-Hooks set, set state to HOOKS_DONE
-    // no plugins registered for this hook, return (reenabled == true)
+  }
+
+  // All done with the current hook chain
+  if (curHook == nullptr) {
     if (eventId == TS_EVENT_SSL_CERT) {
+      // Set the HookState to done because we are all done with the CERT/SERVERNAME hook chains
       sslHandshakeHookState = HANDSHAKE_HOOKS_DONE;
     } else if (eventId == TS_EVENT_SSL_SERVERNAME) {
+      // Reset the HookState to PRE, so the cert hook chain can start
       sslHandshakeHookState = HANDSHAKE_HOOKS_PRE;
     }
   }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.