summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-27 18:42:46 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-27 18:42:46 +0200
commit465675b124a50e8cbd6a114fd277ea18adcc4d31 (patch)
tree76f86e9ae9663276f5a1f29975f86bfeb86e858e /src/modules
parent2a924db786cfb2531126f56a8227bd46c63e444c (diff)
m_spanningtree Don't send needless BURST after introducing a server
Synthesize a BURST after SERVER for 1202 protocol servers if we are not bursting
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/compat.cpp14
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 83ad77414..9f25f251d 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -280,6 +280,15 @@ void TreeSocket::WriteLine(const std::string& original_line)
line.erase(d, spcolon-d);
line.insert(c, " * 0");
+
+ if (burstsent)
+ {
+ WriteLineNoCompat(line);
+
+ // Synthesize a :<newserver> BURST <time> message
+ spcolon = line.find(" :");
+ line = CmdBuilder(line.substr(spcolon-3, 3), "BURST").push_int(ServerInstance->Time()).str();
+ }
}
}
WriteLineNoCompat(line);
@@ -461,6 +470,11 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std:
params[1].swap(params[3]);
params.erase(params.begin()+2, params.begin()+4);
}
+ else if (cmd == "BURST")
+ {
+ // A server is introducing another one, drop unnecessary BURST
+ return false;
+ }
return true; // Passthru
}
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index e5989bd28..ef371212a 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -169,8 +169,6 @@ void TreeSocket::ProcessLine(std::string &line)
return;
FinishAuth(capab->name, capab->sid, capab->description, capab->hidden);
-
- CmdBuilder(MyRoot->GetID(), "BURST").insert(params).Forward(MyRoot);
}
else if (command == "ERROR")
{