diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs index de8b521..0a8331f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | |||
@@ -207,14 +207,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
207 | 207 | ||
208 | int dripAmount = deltaMS * tokensPerMS; | 208 | int dripAmount = deltaMS * tokensPerMS; |
209 | 209 | ||
210 | if (dripAmount < 0) | ||
211 | Console.WriteLine("MAY DAY MAY DAY! Drip amount is " + dripAmount + ". This should not happen"); | ||
212 | |||
213 | content = Math.Min(content + dripAmount, maxBurst); | 210 | content = Math.Min(content + dripAmount, maxBurst); |
214 | lastDrip = now; | 211 | lastDrip = now; |
215 | 212 | ||
216 | if (content < 0) | 213 | if (dripAmount < 0 || content < 0) |
217 | Console.WriteLine("MAY DAY MAY DAY! Content is " + content + ". This should not happen"); | 214 | // sim has been idle for too long, integer has overflown |
215 | // previous calculation is meaningless, let's put it at correct max | ||
216 | content = maxBurst; | ||
218 | 217 | ||
219 | return true; | 218 | return true; |
220 | } | 219 | } |