]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/handshaketimer.cpp
Add config <options:disablehmac> to support disabling of HMAC, and tidy up to detect...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / handshaketimer.cpp
index e0c471af754b48939f5822bd58249c70cfe54b9f..a8562a0f1a1fe96566f63a6bfda7fe90c70d5268 100644 (file)
@@ -1,3 +1,16 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
 #include "configreader.h"
 #include "users.h"
 #include "channels.h"
@@ -28,18 +41,21 @@ 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();
+                       }
+                       else
+                       {
+                               Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils));
+                       }
                }
        }
 }