summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/main.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-05 16:26:03 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-05 16:26:03 +0000
commitd21682a3a012e00e2e9b97bed63ca0683f3ddd95 (patch)
tree35b8bc4762feff3651d7722d91cdf20b520e24ea /src/modules/m_spanningtree/main.cpp
parent645f0aa63434f4773aaf880b4d3bba7bb1dc240e (diff)
Fix multiple burst notifications in a better way (force EOB was quite often hitting in too quickly, will only trigger on servers not EOB after 60 seconds now)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9358 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
-rw-r--r--src/modules/m_spanningtree/main.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 82b05d848..8ddbe5e30 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -218,17 +218,25 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime)
}
}
+
/*
* Cancel remote burst mode on any servers which still have it enabled due to latency/lack of data.
* This prevents lost REMOTECONNECT notices
- * XXX this should probably not do this until server has been bursting for, say, 60 seconds or something
*/
+ timeval t;
+ gettimeofday(&t, NULL);
+ long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000);
+
for (server_hash::iterator i = Utils->serverlist.begin(); i != Utils->serverlist.end(); i++)
{
if (i->second->bursting)
{
- ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst.", i->second->GetName().c_str());
- i->second->FinishBurst();
+ unsigned long bursttime = ts - i->second->StartBurst;
+ if (bursttime > 60000) // A minute
+ {
+ ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not finished burst, forcing end of burst.", i->second->GetName().c_str());
+ i->second->FinishBurst();
+ }
}
}
}