aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treesocket2.cpp
diff options
context:
space:
mode:
authorGravatar w00t2008-02-03 00:21:55 +0000
committerGravatar w00t2008-02-03 00:21:55 +0000
commit43aaead8a8f31ebe2d5eda053c51016b8a2fadb2 (patch)
tree3fa200abfae4573755c8e4aafd4fb46cb248d690 /src/modules/m_spanningtree/treesocket2.cpp
parentRemove an obsolete value (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
Diffstat (limited to 'src/modules/m_spanningtree/treesocket2.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp17
1 files changed, 16 insertions, 1 deletions
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);