]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.cpp
Fix typo opermoth -> opermotd. Thanks Ankit.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.cpp
index c6c9ae700f2c3a3fa269a88f000d41524e9f0b40..f6e3ad6bd337303debe8a49b74a9dc52e3be53cb 100644 (file)
@@ -48,7 +48,7 @@ void ServerSocketListener::OnAcceptReady(const std::string &ipconnectedto, int n
 
                if (!found)
                {
-                       Utils->Creator->RemoteMessage(NULL,"Server connection from %s denied (no link blocks with that IP address)", ip);
+                       this->ServerInstance->SNO->WriteToSnoMask('l', "Server connection from %s denied (no link blocks with that IP address)", ip);
                        ServerInstance->SE->Close(newsock);
                        return;
                }
@@ -536,7 +536,9 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
 
                }
 
-               L.NextConnectTime = time(NULL) + L.AutoConnect;
+               // Fix: Only trip autoconnects if this wouldn't delay autoconnect..
+               if (L.NextConnectTime > ((time_t)(ServerInstance->Time() + L.AutoConnect)))
+                       L.NextConnectTime = ServerInstance->Time() + L.AutoConnect;
 
                if (L.Name.find('.') == std::string::npos)
                        throw CoreException("The link name '"+assign(L.Name)+"' is invalid and must contain at least one '.' character");
@@ -628,7 +630,7 @@ void SpanningTreeUtilities::DoFailOver(Link* x)
        {
                if (x->FailOver == x->Name)
                {
-                       Creator->RemoteMessage(NULL,"FAILOVER: Some muppet configured the failover for server \002%s\002 to point at itself. Not following it!", x->Name.c_str());
+                       this->ServerInstance->SNO->WriteToSnoMask('l', "FAILOVER: Some muppet configured the failover for server \002%s\002 to point at itself. Not following it!", x->Name.c_str());
                        return;
                }
                Link* TryThisOne = this->FindLink(x->FailOver.c_str());
@@ -641,13 +643,13 @@ void SpanningTreeUtilities::DoFailOver(Link* x)
                        }
                        else
                        {
-                               Creator->RemoteMessage(NULL,"FAILOVER: Trying failover link for \002%s\002: \002%s\002...", x->Name.c_str(), TryThisOne->Name.c_str());
+                               this->ServerInstance->SNO->WriteToSnoMask('l', "FAILOVER: Trying failover link for \002%s\002: \002%s\002...", x->Name.c_str(), TryThisOne->Name.c_str());
                                Creator->ConnectServer(TryThisOne);
                        }
                }
                else
                {
-                       Creator->RemoteMessage(NULL,"FAILOVER: Invalid failover server specified for server \002%s\002, will not follow!", x->Name.c_str());
+                       this->ServerInstance->SNO->WriteToSnoMask('l', "FAILOVER: Invalid failover server specified for server \002%s\002, will not follow!", x->Name.c_str());
                }
        }
 }