X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fhandshaketimer.cpp;h=1108c5dccdf8fc39463e5460c671472b8f9505c4;hb=2b68243097f98ace4a53b21520718874b0ed7db5;hp=e57141a7c2be25e4c9ad25188c61bc6b9a14a2e7;hpb=663a113180ceeab1fe5e86412de3c2afc1e23d4f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp index e57141a7c..1108c5dcc 100644 --- a/src/modules/m_spanningtree/handshaketimer.cpp +++ b/src/modules/m_spanningtree/handshaketimer.cpp @@ -11,14 +11,10 @@ * --------------------------------------------------- */ -#include "configreader.h" -#include "users.h" -#include "channels.h" -#include "modules.h" +#include "inspircd.h" #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 +28,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) : Timer(delay, time(NULL)), Instance(Inst), sock(s), lnk(l), Utils(u) { thefd = sock->GetFd(); } @@ -44,21 +40,17 @@ 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)+" 0 :"+this->Instance->Config->ServerDesc); } else { - if (sock->GetHook() && InspSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) + if (sock->GetHook() && BufferedSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) { - InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); + BufferedSocketAttachCertRequest(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)+" 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)); } } }