From 495ea4be05859f46cbf99c10541210fa3590f01a Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 16 Mar 2009 17:44:06 +0000 Subject: Instead of re adding the HandshakeTimer in m_spanningtree, make it a reoccurring timer and kill at the right time. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11227 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/handshaketimer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp index d2e053047..ae41bad0a 100644 --- a/src/modules/m_spanningtree/handshaketimer.cpp +++ b/src/modules/m_spanningtree/handshaketimer.cpp @@ -27,7 +27,7 @@ /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */ -HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : Timer(delay, Inst->Time()), Instance(Inst), sock(s), lnk(l), Utils(u) +HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : Timer(delay, Inst->Time(), true), Instance(Inst), sock(s), lnk(l), Utils(u) { thefd = sock->GetFd(); } @@ -38,18 +38,20 @@ void HandshakeTimer::Tick(time_t TIME) { if (!sock->GetHook()) { + CancelRepeat(); sock->SendCapabilities(); } else { if (sock->GetHook() && BufferedSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) { + CancelRepeat(); BufferedSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); sock->SendCapabilities(); } else { - Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils, 1)); + // Try again later... } } } -- cgit v1.2.3