diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 14 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 23 |
2 files changed, 21 insertions, 16 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(); + } } } } diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index dd81a575e..db26b3f88 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -142,19 +142,16 @@ std::string& TreeServer::GetID() void TreeServer::FinishBurst() { - if (!this->bursting) - { - this->bursting = false; - ServerInstance->XLines->ApplyLines(); - timeval t; - gettimeofday(&t, NULL); - long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000); - unsigned long bursttime = ts - this->StartBurst; - ServerInstance->SNO->WriteToSnoMask('l', "Received end of netburst from \2%s\2 (burst time: %lu %s)", ServerName.c_str(), - (bursttime > 1000 ? bursttime / 1000 : bursttime), (bursttime > 1000 ? "secs" : "msecs")); - Event rmode((char*)ServerName.c_str(), (Module*)Utils->Creator, "new_server"); - rmode.Send(ServerInstance); - } + this->bursting = false; + ServerInstance->XLines->ApplyLines(); + timeval t; + gettimeofday(&t, NULL); + long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000); + unsigned long bursttime = ts - this->StartBurst; + ServerInstance->SNO->WriteToSnoMask('l', "Received end of netburst from \2%s\2 (burst time: %lu %s)", ServerName.c_str(), + (bursttime > 1000 ? bursttime / 1000 : bursttime), (bursttime > 1000 ? "secs" : "msecs")); + Event rmode((char*)ServerName.c_str(), (Module*)Utils->Creator, "new_server"); + rmode.Send(ServerInstance); } void TreeServer::SetID(const std::string &id) |