Skip to content

Commit

Permalink
Fix PingFlag not being set correctly for servers whose burst takes lo…
Browse files Browse the repository at this point in the history
…nger than PingFreq

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11324 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
danieldg committed Apr 22, 2009
1 parent 195b60f commit c15f083
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 0 additions & 2 deletions src/modules/m_spanningtree/server.cpp
Expand Up @@ -80,7 +80,6 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque<std::string>
params[4] = ":" + params[4];
Utils->DoOneToAllButSender(prefix,"SERVER",params,prefix);
this->ServerInstance->SNO->WriteToSnoMask('L', "Server \002"+ParentOfThis->GetName()+"\002 introduced server \002"+servername+"\002 ("+description+")");
Node->bursting = true;
return true;
}

Expand Down Expand Up @@ -172,7 +171,6 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
params[1] = "*";
Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",params,sname);

Node->bursting = true;
this->DoBurst(Node);
return true;
}
Expand Down
23 changes: 5 additions & 18 deletions src/modules/m_spanningtree/treeserver.cpp
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
5 changes: 0 additions & 5 deletions src/modules/m_spanningtree/treeserver.h
Expand Up @@ -56,11 +56,6 @@ class TreeServer : public classbase
bool Warned; /* True if we've warned opers about high latency on this server */
bool bursting; /* whether or not this server is bursting */

/** We don't use this constructor. Its a dummy, and won't cause any insertion
* of the TreeServer into the hash_map. See below for the two we DO use.
*/
TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &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.
Expand Down

0 comments on commit c15f083

Please sign in to comment.