]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/handshaketimer.cpp
Store id in TreeServer, use TreeServer::GetID() to get the id (NOTE: it is std::string)
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / handshaketimer.cpp
index 57a7eecedd5458c98afe196f108d6dfdff10a377..4aeb1da88e2eefd86321e9080ee373ad117e088f 100644 (file)
@@ -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+" "+lnk->SendPass+" 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+" "+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));
                        }
                }
        }