]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
m_spanningtree Refuse topic changes that would result in desync
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index 2198d6208c1f6927f2e386eae57dd25543047710..370c38d2c41a222f5a8728cf49dd70e2ecc61b87 100644 (file)
@@ -37,7 +37,7 @@
  * and only do minor initialization tasks ourselves.
  */
 TreeSocket::TreeSocket(Link* link, Autoconnect* myac, const std::string& ipaddr)
-       : linkID(assign(link->Name)), LinkState(CONNECTING), MyRoot(NULL), proto_version(0)
+       : linkID(link->Name), LinkState(CONNECTING), MyRoot(NULL), proto_version(0)
        , burstsent(false), age(ServerInstance->Time())
 {
        capab = new CapabData;
@@ -60,8 +60,21 @@ TreeSocket::TreeSocket(int newfd, ListenSocket* via, irc::sockets::sockaddrs* cl
        capab = new CapabData;
        capab->capab_phase = 0;
 
-       if (via->iohookprov)
-               via->iohookprov->OnAccept(this, client, server);
+       for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i)
+       {
+               ListenSocket::IOHookProvRef& iohookprovref = *i;
+               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);
 
        Utils->timeoutlist[this] = std::pair<std::string, int>(linkID, 30);