From 65072d44f23804d85dd800c5ce6aa3548831142e Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 10 Apr 2013 17:05:13 +0200 Subject: m_spanningtree Create new TreeServers for incoming connections only when they've accepted our credentials, not when they send SERVER --- src/modules/m_spanningtree/treesocket2.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/modules/m_spanningtree/treesocket2.cpp') diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 04ca9edb1..5007fe921 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -164,9 +164,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); -- cgit v1.3.1-10-gc9f91