From 7ef5a79fef02fd59da6689b8dbcff8db6ab36149 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 17 Dec 2008 19:01:47 +0000 Subject: Change the PacketQueue to use the stored size as well --- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 39 +++++++++------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 2d02dfc..4383493 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -345,9 +345,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); SendQueue.Enqueue(qpack); - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - ResendThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + ResendThrottle.AddBytes(qpack.Length); qchanged = true; } @@ -357,9 +356,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); SendQueue.Enqueue(qpack); - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - LandThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + LandThrottle.AddBytes(qpack.Length); qchanged = true; } @@ -368,9 +366,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); SendQueue.Enqueue(qpack); - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - WindThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + WindThrottle.AddBytes(qpack.Length); qchanged = true; } @@ -379,9 +376,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); SendQueue.Enqueue(qpack); - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - CloudThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + CloudThrottle.AddBytes(qpack.Length); qchanged = true; } @@ -399,9 +395,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP SendQueue.Enqueue(qpack); } - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - TaskThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + TaskThrottle.AddBytes(qpack.Length); qchanged = true; } @@ -410,9 +405,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); SendQueue.Enqueue(qpack); - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - TextureThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + TextureThrottle.AddBytes(qpack.Length); qchanged = true; } @@ -421,9 +415,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); SendQueue.Enqueue(qpack); - int qpackSize = qpack.Packet.ToBytes().Length; - TotalThrottle.AddBytes(qpackSize); - AssetThrottle.AddBytes(qpackSize); + TotalThrottle.AddBytes(qpack.Length); + AssetThrottle.AddBytes(qpack.Length); qchanged = true; } } @@ -451,8 +444,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Monitor.Enter(this); - throttle.AddBytes(item.Packet.ToBytes().Length); - TotalThrottle.AddBytes(item.Packet.ToBytes().Length); + throttle.AddBytes(item.Length); + TotalThrottle.AddBytes(item.Length); SendQueue.Enqueue(item); } catch (Exception e) -- cgit v1.1