X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fhandshaketimer.cpp;h=4aeb1da88e2eefd86321e9080ee373ad117e088f;hb=66d187fa55b4fdcb38ec987c269c4c1573a441b5;hp=a82ea7ea00b5b6f7a5067df0965971de74858070;hpb=fdecf7fb707c415a54c3f41fd45fbc41f6ae4f3d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp index a82ea7ea0..4aeb1da88 100644 --- a/src/modules/m_spanningtree/handshaketimer.cpp +++ b/src/modules/m_spanningtree/handshaketimer.cpp @@ -11,6 +11,7 @@ * --------------------------------------------------- */ +#include "inspircd.h" #include "configreader.h" #include "users.h" #include "channels.h" @@ -18,7 +19,6 @@ #include "commands/cmd_whois.h" #include "commands/cmd_stats.h" #include "socket.h" -#include "inspircd.h" #include "wildcard.h" #include "xline.h" #include "transport.h" @@ -32,7 +32,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) : InspTimer(1, time(NULL)), Instance(Inst), sock(s), lnk(l), Utils(u) +HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : InspTimer(delay, time(NULL)), Instance(Inst), sock(s), lnk(l), Utils(u) { thefd = sock->GetFd(); } @@ -44,8 +44,6 @@ void HandshakeTimer::Tick(time_t TIME) if (!sock->GetHook()) { sock->SendCapabilities(); - if (sock->GetLinkState() == CONNECTING) - sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass, sock->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc); } else { @@ -53,12 +51,10 @@ void HandshakeTimer::Tick(time_t TIME) { InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); sock->SendCapabilities(); - if (sock->GetLinkState() == CONNECTING) - sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass, sock->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc); } else { - Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils)); + Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils, 1)); } } }