Detect negative dripAmounts in TokenBuckets. These negatives result from overflown integer operations. Also added Total to the scene throttles in show throttles.

0.7.1-dev
Diva Canto 2011-02-09 08:06:20 -08:00
parent ba202ea9b0
commit 473fac4dc7
2 changed files with 4 additions and 1 deletions

View File

@ -207,6 +207,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int dripAmount = deltaMS * tokensPerMS; int dripAmount = deltaMS * tokensPerMS;
if (dripAmount < 0)
Console.WriteLine("MAY DAY MAY DAY! Drip amount is " + dripAmount + ". This should not happen");
content = Math.Min(content + dripAmount, maxBurst); content = Math.Min(content + dripAmount, maxBurst);
lastDrip = now; lastDrip = now;

View File

@ -361,7 +361,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
ThrottleRates throttleRates = udpServer.ThrottleRates; ThrottleRates throttleRates = udpServer.ThrottleRates;
report.AppendFormat( report.AppendFormat(
"{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}", "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
"n/a", (throttleRates.Total * 8) / 1000,
(throttleRates.ResendLimit * 8) / 1000, (throttleRates.ResendLimit * 8) / 1000,
(throttleRates.LandLimit * 8) / 1000, (throttleRates.LandLimit * 8) / 1000,
(throttleRates.WindLimit * 8) / 1000, (throttleRates.WindLimit * 8) / 1000,