aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treeserver.cpp
diff options
context:
space:
mode:
authorGravatar danieldg2009-04-22 02:26:03 +0000
committerGravatar danieldg2009-04-22 02:26:03 +0000
commitc15f083ba338d3df7b31dbd33083ef23ab7dd12d (patch)
treec83d6b6671307831eb9f5c7a1038f6bd31cc9183 /src/modules/m_spanningtree/treeserver.cpp
parentAbort link early when mismatched modules are detected so that the error messa... (diff)
Fix PingFlag not being set correctly for servers whose burst takes longer than PingFreq
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11324 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.cpp')
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 455b49c84..ff16b6d60 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -23,20 +23,6 @@
/* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h */
-TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &id) : ServerInstance(Instance), Utils(Util)
-{
- Parent = NULL;
- bursting = false;
- ServerName.clear();
- ServerDesc.clear();
- VersionString.clear();
- ServerUserCount = ServerOperCount = 0;
- StartBurst = rtt = 0;
- Warned = Hidden = false;
- VersionString = ServerInstance->GetVersionString();
- SetID(id);
-}
-
/** We use this constructor only to create the 'root' item, Utils->TreeRoot, which
* represents our own server. Therefore, it has no route, no parent, and
* no socket associated with it. Its version string is our own local version.
@@ -64,13 +50,12 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id, TreeServer* Above, TreeSocket* Sock, bool Hide)
: ServerInstance(Instance), Parent(Above), ServerName(Name.c_str()), ServerDesc(Desc), Socket(Sock), Utils(Util), Hidden(Hide)
{
- bursting = false;
+ bursting = true;
VersionString.clear();
ServerUserCount = ServerOperCount = 0;
this->SetNextPingTime(ServerInstance->Time() + Utils->PingFreq);
- this->SetPingFlag();
Warned = false;
- StartBurst = rtt = 0;
+ rtt = 0;
timeval t;
gettimeofday(&t, NULL);
@@ -157,7 +142,9 @@ void TreeServer::FinishBurst()
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"));
+ ServerInstance->SNO->WriteToSnoMask('l', "Received end of netburst from \2%s\2 (burst time: %lu %s)",
+ ServerName.c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
+ SetPingFlag();
Event rmode((char*)ServerName.c_str(), (Module*)Utils->Creator, "new_server");
rmode.Send(ServerInstance);
}