diff options
author | psychon <psychon@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-16 17:44:06 +0000 |
---|---|---|
committer | psychon <psychon@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-16 17:44:06 +0000 |
commit | 495ea4be05859f46cbf99c10541210fa3590f01a (patch) | |
tree | 816ce6506f700d0973c271adcf6f0528616e5ef6 /src | |
parent | 789ddb96f52235dca90b095bd5d9c1816e73bce4 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/handshaketimer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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... } } } |