diff options
| author | 2025-10-31 18:25:17 +0000 | |
|---|---|---|
| committer | 2025-10-31 18:25:17 +0000 | |
| commit | 41adf8aea67c4b1bd3b69067e4e12ff6bf06a7d7 (patch) | |
| tree | 6a1e3d138a59d716cd46658d437ae33e7846e03d /modules/extra/ssl_openssl.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
Reduce nesting in OnCleanup hooks.
Diffstat (limited to 'modules/extra/ssl_openssl.cpp')
| -rw-r--r-- | modules/extra/ssl_openssl.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/modules/extra/ssl_openssl.cpp b/modules/extra/ssl_openssl.cpp index 1f63c24e3..3398e78f4 100644 --- a/modules/extra/ssl_openssl.cpp +++ b/modules/extra/ssl_openssl.cpp @@ -1056,17 +1056,16 @@ public: void OnCleanup(ExtensionType type, Extensible* item) override { - if (type == ExtensionType::USER) - { - LocalUser* user = IS_LOCAL((User*)item); + if (type != ExtensionType::USER) + return; - if (user && user->io->GetSocket() && user->io->GetSocket()->GetModHook(this)) - { - // User is using TLS, they're a local user, and they're using one of *our* TLS ports. - // Potentially there could be multiple TLS modules loaded at once on different ports. - ServerInstance->Users.QuitUser(user, "OpenSSL module unloading"); - } - } + auto* user = IS_LOCAL(static_cast<User*>(item)); + if (!user || !user->io->GetSocket() || !user->io->GetSocket()->GetModHook(this)) + return; + + // User is using TLS, they're a local user, and they're using one of *our* TLS ports. + // Potentially there could be multiple TLS modules loaded at once on different ports. + ServerInstance->Users.QuitUser(user, "OpenSSL module unloading"); } ModResult OnCheckReady(LocalUser* user) override |
