summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/compat.cpp
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/m_spanningtree/compat.cpp
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/m_spanningtree/compat.cpp')
-rw-r--r--src/modules/m_spanningtree/compat.cpp14
1 files changed, 14 insertions, 0 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
}