]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
Change CacheRefreshTimer tick time back to 5 minutes
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index 1504a88075d4e6b326a57b859a53faa5a53d66b9..1b3b9dae2e8bba907a04097e4f0367cbf099ee29 100644 (file)
@@ -160,9 +160,21 @@ void TreeSocket::ProcessLine(std::string &line)
                                                ServerInstance->SNO->WriteGlobalSno('l',"\2WARNING\2: Your clocks are out by %d seconds. Please consider synching your clocks.", abs((long)delta));
                                        }
                                }
+
+                               // Check for duplicate server name/sid again, it's possible that a new
+                               // server was introduced while we were waiting for them to send BURST.
+                               // (we do not reserve their server name/sid when they send SERVER, we do it now)
+                               if (!CheckDuplicate(capab->name, capab->sid))
+                                       return;
+
                                this->LinkState = CONNECTED;
                                Utils->timeoutlist.erase(this);
 
+                               linkID = capab->name;
+
+                               MyRoot = new TreeServer(Utils, capab->name, capab->description, capab->sid, Utils->TreeRoot, this, capab->hidden);
+                               Utils->TreeRoot->AddChild(MyRoot);
+
                                MyRoot->bursting = true;
                                this->DoBurst(MyRoot);
 
@@ -286,7 +298,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
        if ((!route_back_again) || (route_back_again->GetSocket() != this))
        {
                if (route_back_again)
-                       ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG,"Protocol violation: Fake direction '%s' from connection '%s'",
+                       ServerInstance->Logs->Log("m_spanningtree", LOG_DEBUG, "Protocol violation: Fake direction '%s' from connection '%s'",
                                prefix.c_str(),linkID.c_str());
                return;
        }
@@ -451,7 +463,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
                                return;
                        }
                }
-               who->ForceNickChange(params[0].c_str());
+               who->ForceNickChange(params[0]);
                Utils->RouteCommand(route_back_again, command, params, who);
        }
        else