diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index 2a60b48..b1f2236 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | |||
@@ -312,6 +312,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
312 | 312 | ||
313 | // Determine the interval over which we are adding tokens, never add | 313 | // Determine the interval over which we are adding tokens, never add |
314 | // more than a single quantum of tokens | 314 | // more than a single quantum of tokens |
315 | |||
316 | // No... add no more than the estimated time between checks | ||
317 | |||
315 | Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum); | 318 | Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum); |
316 | m_lastDrip = Util.EnvironmentTickCount(); | 319 | m_lastDrip = Util.EnvironmentTickCount(); |
317 | 320 | ||
@@ -322,6 +325,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
322 | 325 | ||
323 | Deposit(deltaMS * DripRate / m_ticksPerQuantum); | 326 | Deposit(deltaMS * DripRate / m_ticksPerQuantum); |
324 | } | 327 | } |
328 | |||
329 | public void Tick() | ||
330 | { | ||
331 | m_lastDrip = Util.EnvironmentTickCount(); | ||
332 | } | ||
325 | } | 333 | } |
326 | 334 | ||
327 | public class AdaptiveTokenBucket : TokenBucket | 335 | public class AdaptiveTokenBucket : TokenBucket |
@@ -333,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
333 | /// packet per second. Open the throttle to 15 packets per second | 341 | /// packet per second. Open the throttle to 15 packets per second |
334 | /// or about 160kbps. | 342 | /// or about 160kbps. |
335 | /// </summary> | 343 | /// </summary> |
336 | protected const Int64 m_minimumFlow = m_minimumDripRate * 15; | 344 | protected const Int64 m_minimumFlow = m_minimumDripRate; |
337 | 345 | ||
338 | // <summary> | 346 | // <summary> |
339 | // The maximum rate for flow control. Drip rate can never be | 347 | // The maximum rate for flow control. Drip rate can never be |