diff options
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 89a9401..e760513 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -616,6 +616,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
616 | { | 616 | { |
617 | // No packets in this queue. Fire the queue empty callback | 617 | // No packets in this queue. Fire the queue empty callback |
618 | // if it has not been called recently | 618 | // if it has not been called recently |
619 | |||
620 | bucket.Tick(); // tick the bucket | ||
619 | emptyCategories |= CategoryToFlag(i); | 621 | emptyCategories |= CategoryToFlag(i); |
620 | } | 622 | } |
621 | } | 623 | } |
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 |