From 6b8d01d8c4b4c4f05e0bc51724984dab22e4ee51 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 13 Dec 2010 11:45:17 -0800
Subject: It turns out that the 1/2 sec burst for prims download is not a bug,
but a feature of the client. The client sets the throttles in such a way that
makes the server behave like that. The same happens in the Linden Grid.
Revert "This may have been the biggest, baddest bug in OpenSim ever...
confusion between bytes per second and bytes per millisecond."
This reverts commit 870bbcfc6c264c515ac660837d16ccad4e59ac64.
---
OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
index 4d9ca09..bdbd284 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
@@ -119,10 +119,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion Properties
- // To help debugging
- private static int idCount = 0;
- private int id;
-
///
/// Default constructor
///
@@ -138,7 +134,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
MaxBurst = maxBurst;
DripRate = dripRate;
lastDrip = Environment.TickCount & Int32.MaxValue;
- id = idCount++;
}
///
@@ -196,7 +191,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (tokensPerMS == 0)
{
content = maxBurst;
- //Console.WriteLine("XXX (" + id + ") content = maxBurst and maxBurst = " + maxBurst);
return true;
}
else
@@ -211,14 +205,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return false;
}
- // dripAmpount here is in bytes per millisecond
- int dripAmount = deltaMS * tokensPerMS;
- // but content is in bytes per second, so let's multiply by 1000
- dripAmount = dripAmount * 1000;
+ int dripAmount = deltaMS * tokensPerMS;
+
content = Math.Min(content + dripAmount, maxBurst);
lastDrip = now;
- //Console.WriteLine("XXX (" + id + ") deltaMS=" + deltaMS + "; tokensPerMS=" + tokensPerMS + "; content=" + content + "; dripAmount=" + dripAmount);
return true;
}
}
--
cgit v1.1