aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
index e67c0f5..38ae760 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
@@ -395,16 +395,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
395 /// The minimum rate for adaptive flow control. 395 /// The minimum rate for adaptive flow control.
396 /// </summary> 396 /// </summary>
397 protected Int64 m_minimumFlow = 32000; 397 protected Int64 m_minimumFlow = 32000;
398 public Int64 MinimumFlow
399 {
400 get { return m_minimumFlow; }
401 set
402 {
403 m_minimumFlow = value;
404 TargetDripRate = Math.Max(m_minimumFlow, TargetDripRate);
405 AdjustedDripRate = Math.Max(m_minimumFlow, AdjustedDripRate);
406 }
407 }
408 398
409 /// <summary> 399 /// <summary>
410 /// Constructor for the AdaptiveTokenBucket class 400 /// Constructor for the AdaptiveTokenBucket class
@@ -441,7 +431,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
441 "[ADAPTIVEBUCKET] drop {0} by {1} expired packets for {2}", 431 "[ADAPTIVEBUCKET] drop {0} by {1} expired packets for {2}",
442 AdjustedDripRate, packets, Identifier); 432 AdjustedDripRate, packets, Identifier);
443 433
444 AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,packets)); 434 // AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,packets));
435
436 // Compute the fallback solely on the rate allocated beyond the minimum, this
437 // should smooth out the fallback to the minimum rate
438 AdjustedDripRate = m_minimumFlow + (Int64) ((AdjustedDripRate - m_minimumFlow) / Math.Pow(2, packets));
445 } 439 }
446 } 440 }
447 441
@@ -454,5 +448,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
454 if (AdaptiveEnabled) 448 if (AdaptiveEnabled)
455 AdjustedDripRate = AdjustedDripRate + packets * LLUDPServer.MTU; 449 AdjustedDripRate = AdjustedDripRate + packets * LLUDPServer.MTU;
456 } 450 }
451
452 /// <summary>
453 /// Adjust the minimum flow level for the adaptive throttle, this will drop adjusted
454 /// throttles back to the minimum levels
455 /// <param>minDripRate--the new minimum flow</param>
456 /// </summary>
457 public void ResetMinimumAdaptiveFlow(Int64 minDripRate)
458 {
459 m_minimumFlow = minDripRate;
460 TargetDripRate = m_minimumFlow;
461 AdjustedDripRate = m_minimumFlow;
462 }
457 } 463 }
458} \ No newline at end of file 464} \ No newline at end of file