]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Close connections when an I/O hook is configured but not loaded.
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 4f65994aa29be6399964f51869c5b5546e30d627..bcb831858300a15be917184632684a1aa4b32c64 100644 (file)
@@ -149,10 +149,23 @@ 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 <bind:%s> tag at %s",
+                                       iohookprovref.GetProvider().c_str(),
+                                       i == via->iohookprovs.begin() ? "hook" : "ssl",
+                                       via->bind_tag->getTagLocation().c_str());
+                               this->QuitUser(New, "Internal error handling connection");
+                               return;
+                       }
                        continue;
+               }
 
                iohookprovref->OnAccept(eh, client, server);
-               // IOHook could have encountered a fatal error, e.g. if the TLS ClientHello was already in the queue and there was no common TLS version
+
+               // IOHook could have encountered a fatal error, e.g. if the TLS ClientHello
+               // was already in the queue and there was no common TLS version.
                if (!eh->getError().empty())
                {
                        QuitUser(New, eh->getError());