diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-05-13 00:26:02 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-05-13 00:26:02 +0200 |
commit | 0982b2a58259ec1653e2af93ec612ec98378a087 (patch) | |
tree | 9454d0f4b7b8f02a2a3efe08b462f302d3d1a8aa /src/modules/m_spanningtree/treeserver.cpp | |
parent | a6433b37967e22e19658967ae4e798febea86356 (diff) |
m_spanningtree Use uint64_t for the burst start time to avoid overflows
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.cpp')
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 3835695dd..0750e755c 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -117,16 +117,16 @@ TreeServer::TreeServer(const std::string& Name, const std::string& Desc, const s Parent->Children.push_back(this); } -void TreeServer::BeginBurst(unsigned long startms) +void TreeServer::BeginBurst(uint64_t startms) { behind_bursting++; - unsigned long now = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000); + uint64_t now = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000); // If the start time is in the future (clocks are not synced) then use current time if ((!startms) || (startms > now)) startms = now; this->StartBurst = startms; - ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Server %s started bursting at time %lu behind_bursting %u", sid.c_str(), startms, behind_bursting); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Server %s started bursting at time %s behind_bursting %u", sid.c_str(), ConvToStr(startms).c_str(), behind_bursting); } void TreeServer::FinishBurstInternal() @@ -147,7 +147,7 @@ void TreeServer::FinishBurstInternal() void TreeServer::FinishBurst() { ServerInstance->XLines->ApplyLines(); - long ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000); + uint64_t ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000); unsigned long bursttime = ts - this->StartBurst; ServerInstance->SNO->WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \2%s\2 (burst time: %lu %s)", GetName().c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs")); |