Avoid checking the throttle limit for empty queues

0.6.1-post-fixes
Melanie Thielker 2008-12-17 09:30:56 +00:00
parent 4b81ec02d7
commit 02a28a6992
2 changed files with 8 additions and 8 deletions

View File

@ -334,7 +334,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
throttleLoops++; throttleLoops++;
//Now comes the fun part.. we dump all our elements into m_packetQueue that we've saved up. //Now comes the fun part.. we dump all our elements into m_packetQueue that we've saved up.
if (ResendThrottle.UnderLimit() && ResendOutgoingPacketQueue.Count > 0) if ((ResendOutgoingPacketQueue.Count > 0) && ResendThrottle.UnderLimit())
{ {
LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue();
@ -343,7 +343,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length);
} }
if (LandThrottle.UnderLimit() && LandOutgoingPacketQueue.Count > 0) if ((LandOutgoingPacketQueue.Count > 0) && LandThrottle.UnderLimit())
{ {
LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); LLQueItem qpack = LandOutgoingPacketQueue.Dequeue();
@ -352,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); LandThrottle.AddBytes(qpack.Packet.ToBytes().Length);
} }
if (WindThrottle.UnderLimit() && WindOutgoingPacketQueue.Count > 0) if ((WindOutgoingPacketQueue.Count > 0) && WindThrottle.UnderLimit())
{ {
LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); LLQueItem qpack = WindOutgoingPacketQueue.Dequeue();
@ -361,7 +361,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); WindThrottle.AddBytes(qpack.Packet.ToBytes().Length);
} }
if (CloudThrottle.UnderLimit() && CloudOutgoingPacketQueue.Count > 0) if ((CloudOutgoingPacketQueue.Count > 0) && CloudThrottle.UnderLimit())
{ {
LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue();
@ -370,7 +370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length); CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length);
} }
if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)) if ((TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0) && TaskThrottle.UnderLimit())
{ {
LLQueItem qpack; LLQueItem qpack;
if (TaskOutgoingPacketQueue.Count > 0) if (TaskOutgoingPacketQueue.Count > 0)
@ -387,7 +387,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length);
} }
if (TextureThrottle.UnderLimit() && TextureOutgoingPacketQueue.Count > 0) if ((TextureOutgoingPacketQueue.Count > 0) && TextureThrottle.UnderLimit())
{ {
LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue();
@ -396,7 +396,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length);
} }
if (AssetThrottle.UnderLimit() && AssetOutgoingPacketQueue.Count > 0) if ((AssetOutgoingPacketQueue.Count > 0) && AssetThrottle.UnderLimit())
{ {
LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue();

View File

@ -115,4 +115,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
} }
} }