]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
Check for errors after calling IOHookProvider::OnAccept()
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index a96c4a90c0bd4d0352f9f33f4a44eb0610166881..370c38d2c41a222f5a8728cf49dd70e2ecc61b87 100644 (file)
@@ -63,8 +63,16 @@ TreeSocket::TreeSocket(int newfd, ListenSocket* via, irc::sockets::sockaddrs* cl
        for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i)
        {
                ListenSocket::IOHookProvRef& iohookprovref = *i;
-               if (iohookprovref)
-                       iohookprovref->OnAccept(this, client, server);
+               if (!iohookprovref)
+                       continue;
+
+               iohookprovref->OnAccept(this, 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
+               if (!getError().empty())
+               {
+                       TreeSocket::OnError(I_ERR_OTHER);
+                       return;
+               }
        }
 
        SendCapabilities(1);