summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-03 00:21:55 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-03 00:21:55 +0000
commit43aaead8a8f31ebe2d5eda053c51016b8a2fadb2 (patch)
tree3fa200abfae4573755c8e4aafd4fb46cb248d690
parent1c63bc4c57bb27b305b1624a4c8e415ac914662b (diff)
Broken, but.. show how many milliseconds a burst takes. Someone care to tell me why this is fucked/fix it?
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8801 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree/treeserver.h4
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp17
2 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h
index 06e827fdc..f42e5680f 100644
--- a/src/modules/m_spanningtree/treeserver.h
+++ b/src/modules/m_spanningtree/treeserver.h
@@ -120,6 +120,10 @@ class TreeServer : public classbase
/** Round trip time of last ping
*/
unsigned long rtt;
+
+ /** When we recieved BURST from this server, used to calculate total burst time at ENDBURST.
+ */
+ unsigned long StartBurst;
/** True if this server is hidden
*/
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 28f66f0d2..88cdf846d 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -1174,6 +1174,10 @@ bool TreeSocket::ProcessLine(std::string &line)
params.push_back(":"+InboundDescription);
Utils->DoOneToAllButSender(Instance->Config->GetSID(),"SERVER",params,InboundServerName);
this->bursting = true;
+ timeval t;
+ gettimeofday(&t, NULL);
+ long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000);
+ Node->StartBurst = ts;
this->DoBurst(Node);
}
else if (command == "ERROR")
@@ -1497,12 +1501,23 @@ bool TreeSocket::ProcessLine(std::string &line)
}
else if (command == "ENDBURST")
{
+ TreeServer* ServerSource = Utils->FindServer(prefix);
+ if (!ServerSource)
+ {
+ this->Instance->SNO->WriteToSnoMask('l', "WTF: Got ENDBURST from a nonexistant server(?): %s", prefix.c_str());
+ return false;
+ }
+
this->bursting = false;
Instance->XLines->ApplyLines();
std::string sourceserv = this->myhost;
if (!this->InboundServerName.empty())
sourceserv = this->InboundServerName;
- this->Instance->SNO->WriteToSnoMask('l',"Received end of netburst from \2%s\2",sourceserv.c_str());
+ timeval t;
+ gettimeofday(&t, NULL);
+ long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000);
+ unsigned long bursttime = ts - ServerSource->StartBurst;
+ this->Instance->SNO->WriteToSnoMask('l', "Received end of netburst from \2%s\2 (burst time: %ul ms)", sourceserv.c_str(), bursttime);
Event rmode((char*)sourceserv.c_str(), (Module*)Utils->Creator, "new_server");
rmode.Send(Instance);