From 6611e75a2beba8d28aed4e1ea56135da491328c0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 2 Sep 2014 16:11:46 +0100 Subject: [PATCH] void time change between gettime calls --- OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index 384439cb72..1877cf022f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs @@ -304,11 +304,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP return; } - Int32 deltaMS = Util.EnvironmentTickCountSubtract(m_lastDrip); - m_lastDrip = Util.EnvironmentTickCount(); + Int32 now = Util.EnvironmentTickCount(); + Int32 deltaMS = now - m_lastDrip; + m_lastDrip = now; - // This can be 0 in the very unusual case that the timer wrapped - // It can be 0 if we try add tokens at a sub-tick rate if (deltaMS <= 0) return;