1 #include "configreader.h"
5 #include "commands/cmd_whois.h"
6 #include "commands/cmd_stats.h"
11 #include "transport.h"
13 #include "m_spanningtree/main.h"
14 #include "m_spanningtree/utils.h"
15 #include "m_spanningtree/treeserver.h"
16 #include "m_spanningtree/link.h"
17 #include "m_spanningtree/treesocket.h"
18 #include "m_spanningtree/handshaketimer.h"
20 HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u) : InspTimer(1, time(NULL)), Instance(Inst), sock(s), lnk(l), Utils(u)
22 thefd = sock->GetFd();
25 void HandshakeTimer::Tick(time_t TIME)
27 if (Instance->SE->GetRef(thefd) == sock)
29 if (sock->GetHook() && InspSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send())
31 InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
32 sock->SendCapabilities();
33 if (sock->GetLinkState() == CONNECTING)
35 sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+lnk->SendPass+" 0 :"+this->Instance->Config->ServerDesc);
40 Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils));