]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
Don't call events provided by dying or dead modules.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index 5bc41ea64008357f3aadeabdf14dc0e6df896c4b..6d701f22ebe6d9a1aeab8adf765e45ebb87faaf6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com>
  *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
  * and only do minor initialization tasks ourselves.
  */
 TreeSocket::TreeSocket(Link* link, Autoconnect* myac, const irc::sockets::sockaddrs& dest)
-       : linkID(link->Name), LinkState(CONNECTING), MyRoot(NULL), proto_version(0)
-       , burstsent(false), age(ServerInstance->Time())
+       : linkID(link->Name)
+       , LinkState(CONNECTING)
+       , MyRoot(NULL)
+       , proto_version(0)
+       , burstsent(false)
+       , age(ServerInstance->Time())
 {
        capab = new CapabData;
        capab->link = link;
        capab->ac = myac;
        capab->capab_phase = 0;
+       capab->remotesa = dest;
 
        irc::sockets::sockaddrs bind;
        memset(&bind, 0, sizeof(bind));
@@ -77,11 +82,16 @@ TreeSocket::TreeSocket(Link* link, Autoconnect* myac, const irc::sockets::sockad
  */
 TreeSocket::TreeSocket(int newfd, ListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
        : BufferedSocket(newfd)
-       , linkID("inbound from " + client->addr()), LinkState(WAIT_AUTH_1), MyRoot(NULL), proto_version(0)
-       , burstsent(false), age(ServerInstance->Time())
+       , linkID("inbound from " + client->addr())
+       , LinkState(WAIT_AUTH_1)
+       , MyRoot(NULL)
+       , proto_version(0)
+       , burstsent(false)
+       , age(ServerInstance->Time())
 {
        capab = new CapabData;
        capab->capab_phase = 0;
+       capab->remotesa = *client;
 
        for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i)
        {