From bbe6c7c244d9133f87d041d00aec9903c0b0e88d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 31 May 2022 14:04:43 +0100 Subject: Make it more obvious when an I/O hook is misconfigured. --- src/usermanager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 1b93430d7..47d9c5bbb 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -157,16 +157,14 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs ListenSocket::IOHookProvRef& iohookprovref = *i; if (!iohookprovref) { - if (!iohookprovref.GetProvider().empty()) - { - ServerInstance->Logs->Log("USERS", LOG_DEBUG, "Non-existent I/O hook '%s' in tag at %s", - iohookprovref.GetProvider().c_str(), - i == via->iohookprovs.begin() ? "hook" : "sslprofile", - via->bind_tag->getTagLocation().c_str()); - this->QuitUser(New, "Internal error handling connection"); - return; - } - continue; + if (iohookprovref.GetProvider().empty()) + continue; + + const char* hooktype = i == via->iohookprovs.begin() ? "hook" : "sslprofile"; + ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "Non-existent I/O hook '%s' in tag at %s", + iohookprovref.GetProvider().c_str(), hooktype, via->bind_tag->getTagLocation().c_str()); + this->QuitUser(New, InspIRCd::Format("Internal error handling connection (misconfigured %s)", hooktype)); + return; } iohookprovref->OnAccept(eh, client, server); -- cgit v1.3.1-10-gc9f91