From 72ff5322f5e0aa687a624ca726a0f4b613e51923 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 17 Dec 2008 17:18:52 +0000 Subject: * Replace manually zeroing with Array.Clear(). Thanks cmickeyb --- OpenSim/Framework/PacketPool.cs | 4 +--- OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | 4 ++-- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 5 +---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs index e24da42..9994fac 100644 --- a/OpenSim/Framework/PacketPool.cs +++ b/OpenSim/Framework/PacketPool.cs @@ -115,9 +115,7 @@ namespace OpenSim.Framework { PacketType type = GetType(bytes); - int z; - for (z = 0 ; z < zeroBuffer.Length ; z++) - zeroBuffer[z] = 0; + Array.Clear(zeroBuffer, 0, zeroBuffer.Length); int i = 0; Packet packet = GetPacket(type); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index a8785a6..3ce71dc 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -331,10 +331,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // loop, since each pass through the loop checks the queue length, we no longer // need the check on entering the loop bool qchanged = true; + ResetCounters(); // m_log.Info("[THROTTLE]: Entering Throttle"); - while (TotalThrottle.UnderLimit() && qchanged && - (throttleLoops <= MaxThrottleLoops)) + while (TotalThrottle.UnderLimit() && qchanged && throttleLoops <= MaxThrottleLoops) { qchanged = false; // We will break out of the loop if no work was accomplished diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 09b9ac9..2daf425 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -195,10 +195,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Make sure we are getting zeroes when running off the // end of grab / degrab packets from old clients - // - int z; - for (z = numBytes ; z < RecvBuffer.Length ; z++) - RecvBuffer[z] = 0; + Array.Clear(RecvBuffer, numBytes, RecvBuffer.Length - numBytes); int packetEnd = numBytes - 1; if (proxyPortOffset != 0) packetEnd -= 6; -- cgit v1.1