summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/handshaketimer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/handshaketimer.cpp')
-rw-r--r--src/modules/m_spanningtree/handshaketimer.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp
index ae41bad0a..14b27472c 100644
--- a/src/modules/m_spanningtree/handshaketimer.cpp
+++ b/src/modules/m_spanningtree/handshaketimer.cpp
@@ -32,28 +32,24 @@ HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningT
thefd = sock->GetFd();
}
+HandshakeTimer::~HandshakeTimer()
+{
+ sock->hstimer = NULL;
+}
+
void HandshakeTimer::Tick(time_t TIME)
{
- if (Instance->SE->GetRef(thefd) == sock)
+ if (!sock->GetHook())
+ {
+ CancelRepeat();
+ sock->SendCapabilities();
+ }
+ else if (BufferedSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send())
{
- 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
- {
- // Try again later...
- }
- }
+ CancelRepeat();
+ BufferedSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
+ sock->SendCapabilities();
}
+ // otherwise, try again later
}