* Only serialize packets once for the length calculation for throttle queues rather than twice

0.6.1-post-fixes
Justin Clarke Casey 2008-12-17 17:33:57 +00:00
parent 35ec496f98
commit ab77b22f0f
1 changed files with 25 additions and 16 deletions

View File

@ -344,9 +344,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); TotalThrottle.AddBytes(qpackSize);
ResendThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
@ -355,8 +357,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); LLQueItem qpack = LandOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); TotalThrottle.AddBytes(qpackSize);
LandThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
@ -365,8 +368,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); LLQueItem qpack = WindOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); TotalThrottle.AddBytes(qpackSize);
WindThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
@ -375,8 +379,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length); TotalThrottle.AddBytes(qpackSize);
CloudThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
@ -393,8 +398,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
qpack = TaskLowpriorityPacketQueue.Dequeue(); qpack = TaskLowpriorityPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
} }
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length);
TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
TotalThrottle.AddBytes(qpackSize);
TaskThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
@ -402,9 +409,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); TotalThrottle.AddBytes(qpackSize);
TextureThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
@ -413,8 +421,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue();
SendQueue.Enqueue(qpack); SendQueue.Enqueue(qpack);
TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); int qpackSize = qpack.Packet.ToBytes().Length;
AssetThrottle.AddBytes(qpack.Packet.ToBytes().Length); TotalThrottle.AddBytes(qpackSize);
AssetThrottle.AddBytes(qpackSize);
qchanged = true; qchanged = true;
} }
} }