Repository: trafficserver Updated Branches: refs/heads/master bc29489e6 -> c1d845910
TS-3272: SNI callback called too often Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c1d84591 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c1d84591 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c1d84591 Branch: refs/heads/master Commit: c1d845910b33e3a82d840ac9085627dd0bcdbc41 Parents: bc29489 Author: shinrich <[email protected]> Authored: Fri Jan 16 19:50:28 2015 -0600 Committer: shinrich <[email protected]> Committed: Fri Jan 16 19:50:28 2015 -0600 ---------------------------------------------------------------------- iocore/net/SSLNetVConnection.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c1d84591/iocore/net/SSLNetVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc index 04a571e..91ae8e7 100644 --- a/iocore/net/SSLNetVConnection.cc +++ b/iocore/net/SSLNetVConnection.cc @@ -1240,23 +1240,29 @@ SSLNetVConnection::callHooks(TSHttpHookID eventId) // Only dealing with the SNI hook so far ink_assert(eventId == TS_SSL_SNI_HOOK); - APIHook *hook = ssl_hooks->get(TS_SSL_SNI_INTERNAL_HOOK); + if (this->sslSNIHookState == SNI_HOOKS_INIT) { + curHook = ssl_hooks->get(TS_SSL_SNI_INTERNAL_HOOK); + } + else if (curHook != NULL) { + curHook = curHook->next(); + } bool reenabled = true; - while (hook && reenabled) { + while (curHook && reenabled) { // Must reset to a completed state for each invocation this->sslSNIHookState = SNI_HOOKS_DONE; // Invoke the hook - hook->invoke(TS_SSL_SNI_HOOK, this); + curHook->invoke(TS_SSL_SNI_HOOK, this); // If it did not re-enable, return the code to // stop the accept processing if (this->sslSNIHookState == SNI_HOOKS_DONE) { reenabled = false; } - - // Otherwise, look for the next plugin code - hook = hook->next(); + else { + // Otherwise, look for the next plugin code + curHook = curHook->next(); + } } return reenabled; }
