From be36d92f3dcb0ac3772daebff43a5ecfe0a2d364 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 9 Apr 2007 14:07:18 +0000 Subject: Added ability to send and receive a challenge, dont do anything with it yet git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6767 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/handshaketimer.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/modules/m_spanningtree/handshaketimer.cpp') diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp index 32364e278..57a7eeced 100644 --- a/src/modules/m_spanningtree/handshaketimer.cpp +++ b/src/modules/m_spanningtree/handshaketimer.cpp @@ -41,18 +41,25 @@ void HandshakeTimer::Tick(time_t TIME) { if (Instance->SE->GetRef(thefd) == sock) { - if (sock->GetHook() && InspSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) + if (!sock->GetHook()) { - InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); sock->SendCapabilities(); if (sock->GetLinkState() == CONNECTING) - { sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+lnk->SendPass+" 0 :"+this->Instance->Config->ServerDesc); - } } else { - Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils)); + if (sock->GetHook() && InspSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) + { + InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); + sock->SendCapabilities(); + if (sock->GetLinkState() == CONNECTING) + sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+lnk->SendPass+" 0 :"+this->Instance->Config->ServerDesc); + } + else + { + Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils)); + } } } } -- cgit v1.3.1-10-gc9f91