1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_whois.h"
16 #include "commands/cmd_stats.h"
19 #include "transport.h"
21 #include "m_spanningtree/main.h"
22 #include "m_spanningtree/utils.h"
23 #include "m_spanningtree/treeserver.h"
24 #include "m_spanningtree/link.h"
25 #include "m_spanningtree/treesocket.h"
26 #include "m_spanningtree/handshaketimer.h"
28 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
30 HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : Timer(delay, time(NULL)), Instance(Inst), sock(s), lnk(l), Utils(u)
32 thefd = sock->GetFd();
35 void HandshakeTimer::Tick(time_t TIME)
37 if (Instance->SE->GetRef(thefd) == sock)
41 sock->SendCapabilities();
45 if (sock->GetHook() && BufferedSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send())
47 BufferedSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
48 sock->SendCapabilities();
52 Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils, 1));