aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs13
1 files changed, 2 insertions, 11 deletions
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
119 119
120 #endregion Properties 120 #endregion Properties
121 121
122 // To help debugging
123 private static int idCount = 0;
124 private int id;
125
126 /// <summary> 122 /// <summary>
127 /// Default constructor 123 /// Default constructor
128 /// </summary> 124 /// </summary>
@@ -138,7 +134,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
138 MaxBurst = maxBurst; 134 MaxBurst = maxBurst;
139 DripRate = dripRate; 135 DripRate = dripRate;
140 lastDrip = Environment.TickCount & Int32.MaxValue; 136 lastDrip = Environment.TickCount & Int32.MaxValue;
141 id = idCount++;
142 } 137 }
143 138
144 /// <summary> 139 /// <summary>
@@ -196,7 +191,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
196 if (tokensPerMS == 0) 191 if (tokensPerMS == 0)
197 { 192 {
198 content = maxBurst; 193 content = maxBurst;
199 //Console.WriteLine("XXX (" + id + ") content = maxBurst and maxBurst = " + maxBurst);
200 return true; 194 return true;
201 } 195 }
202 else 196 else
@@ -211,14 +205,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
211 return false; 205 return false;
212 } 206 }
213 207
214 // dripAmpount here is in bytes per millisecond 208 int dripAmount = deltaMS * tokensPerMS;
215 int dripAmount = deltaMS * tokensPerMS; 209
216 // but content is in bytes per second, so let's multiply by 1000
217 dripAmount = dripAmount * 1000;
218 content = Math.Min(content + dripAmount, maxBurst); 210 content = Math.Min(content + dripAmount, maxBurst);
219 lastDrip = now; 211 lastDrip = now;
220 212
221 //Console.WriteLine("XXX (" + id + ") deltaMS=" + deltaMS + "; tokensPerMS=" + tokensPerMS + "; content=" + content + "; dripAmount=" + dripAmount);
222 return true; 213 return true;
223 } 214 }
224 } 215 }