From 02a28a699200be6f877d5de8174a33c62837d46c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 17 Dec 2008 09:30:56 +0000 Subject: [PATCH] Avoid checking the throttle limit for empty queues --- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 14 +++++++------- .../ClientStack/LindenUDP/LLPacketThrottle.cs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 194d1b432a..81f39225a0 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -334,7 +334,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { throttleLoops++; //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(); @@ -343,7 +343,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); } - if (LandThrottle.UnderLimit() && LandOutgoingPacketQueue.Count > 0) + if ((LandOutgoingPacketQueue.Count > 0) && LandThrottle.UnderLimit()) { LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); @@ -352,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); } - if (WindThrottle.UnderLimit() && WindOutgoingPacketQueue.Count > 0) + if ((WindOutgoingPacketQueue.Count > 0) && WindThrottle.UnderLimit()) { LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); @@ -361,7 +361,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); } - if (CloudThrottle.UnderLimit() && CloudOutgoingPacketQueue.Count > 0) + if ((CloudOutgoingPacketQueue.Count > 0) && CloudThrottle.UnderLimit()) { LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); @@ -370,7 +370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP 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; if (TaskOutgoingPacketQueue.Count > 0) @@ -387,7 +387,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); } - if (TextureThrottle.UnderLimit() && TextureOutgoingPacketQueue.Count > 0) + if ((TextureOutgoingPacketQueue.Count > 0) && TextureThrottle.UnderLimit()) { LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); @@ -396,7 +396,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); } - if (AssetThrottle.UnderLimit() && AssetOutgoingPacketQueue.Count > 0) + if ((AssetOutgoingPacketQueue.Count > 0) && AssetThrottle.UnderLimit()) { LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index 5037ea5df4..f73892a3b9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs @@ -115,4 +115,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } -} \ No newline at end of file +}