From 5faf58ecb333fcf4721cbffa561c784e299695c4 Mon Sep 17 00:00:00 2001 From: Mo Chen Date: Sun, 19 Jul 2026 13:23:16 -0500 Subject: [PATCH] ssl: remove the dead SSL_HOOK_OP_TERMINATE op No code has ever assigned hookOpRequested this value: the introducing commit (TS-3006, 2014) only wrote it to an example plugin's own struct, and the public TSSslVConnOp API that could have set it was removed in 2016 (TS-4658). A hook rejects a handshake via TSVConnReenableEx(TS_EVENT_ERROR) instead, so drop the enumerator and its unreachable arm in sslServerHandShakeEvent(). --- src/iocore/net/P_SSLNetVConnection.h | 5 ++--- src/iocore/net/SSLNetVConnection.cc | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/iocore/net/P_SSLNetVConnection.h b/src/iocore/net/P_SSLNetVConnection.h index 3ff284ff8cc..ee1a04d9e26 100644 --- a/src/iocore/net/P_SSLNetVConnection.h +++ b/src/iocore/net/P_SSLNetVConnection.h @@ -81,9 +81,8 @@ constexpr int SSL_DEF_TLS_RECORD_MSEC_THRESHOLD = 1000; struct SSLCertLookup; enum class SslVConnOp { - SSL_HOOK_OP_DEFAULT, ///< Null / initialization value. Do normal processing. - SSL_HOOK_OP_TUNNEL, ///< Switch to blind tunnel - SSL_HOOK_OP_TERMINATE ///< Termination connection / transaction. + SSL_HOOK_OP_DEFAULT, ///< Null / initialization value. Do normal processing. + SSL_HOOK_OP_TUNNEL ///< Switch to blind tunnel }; enum class SSLHandshakeStatus { SSL_HANDSHAKE_ONGOING, SSL_HANDSHAKE_DONE, SSL_HANDSHAKE_ERROR }; diff --git a/src/iocore/net/SSLNetVConnection.cc b/src/iocore/net/SSLNetVConnection.cc index 2a2ac30836c..32806412155 100644 --- a/src/iocore/net/SSLNetVConnection.cc +++ b/src/iocore/net/SSLNetVConnection.cc @@ -1309,9 +1309,6 @@ SSLNetVConnection::sslServerHandShakeEvent(int &err) // we get out of this callback, and then will shuffle // over the buffered handshake packets to the O.S. return EVENT_DONE; - } else if (SslVConnOp::SSL_HOOK_OP_TERMINATE == hookOpRequested) { - sslHandshakeStatus = SSLHandshakeStatus::SSL_HANDSHAKE_DONE; - return EVENT_DONE; } Dbg(dbg_ctl_ssl, "Go on with the handshake state=%s",