summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-12-20 14:48:24 +0100
committerPeter Powell <petpow@saberuk.com>2018-12-20 15:08:17 +0100
commit60ae49b62a371791ebbd9e4b131e33b857873f06 (patch)
tree8372cbe3856d6c99965026b09351310df5203d03 /src/modules
parentf904042e9e413cd1ba80a04b8984637f59b73036 (diff)
Fix thinking that 1202 protocol servers have not finished bursting.
A server introduction is only a burst if all of the parent servers of it are not bursting. Fixes #1527.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/compat.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 8e5361b16..3e9485cfa 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -489,9 +489,19 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, Comm
params[1].swap(params[3]);
params.erase(params.begin()+2, params.begin()+4);
- // If the source of this SERVER message is not bursting, then new servers it introduces are bursting
- TreeServer* server = TreeServer::Get(who);
- if (!server->IsBursting())
+ // If the source of this SERVER message or any of its parents are bursting, then new servers it
+ // introduces are not bursting.
+ bool bursting = false;
+ for (TreeServer* server = TreeServer::Get(who); server; server = server->GetParent())
+ {
+ if (server->IsBursting())
+ {
+ bursting = true;
+ break;
+ }
+ }
+
+ if (!bursting)
params.insert(params.begin()+2, "burst=" + ConvToStr(((uint64_t)ServerInstance->Time())*1000));
}
else if (cmd == "BURST")