Numerous packet improvements.

Don't allow packets to be resent before they have actually been sent for the
first time. Switch from serializing a packet to get it's length to the LibOMV
provided Length property. Fix resend timing. Fix the use of dangling references
to Acked packets. Fix the packet handler to play nice with the packet pool.
Fix the packet pool. Add data block recycling to the packet pool. Packet pool
is now ENABLED by default. Add config option to disable packet and data block
reuse. Add ObjectUpdate and ImprovedTerseObjectUpdate to the packets being
recycled.
This commit is contained in:
Melanie Thielker
2009-05-02 13:16:41 +00:00
parent 8c97214741
commit 62bcf0e694
7 changed files with 108 additions and 50 deletions

View File

@@ -83,6 +83,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
internal LLPacketThrottle TextureThrottle;
internal LLPacketThrottle TotalThrottle;
private List<uint> contents = new List<uint>();
/// <summary>
/// The number of packets in the OutgoingPacketQueue
///
@@ -186,6 +188,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
}
if (item.Sequence != 0)
contents.Add(item.Sequence);
lock (this)
{
switch (item.throttleType & ThrottleOutPacketType.TypeMask)
@@ -226,7 +231,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public LLQueItem Dequeue()
{
return SendQueue.Dequeue();
while (true)
{
LLQueItem item = SendQueue.Dequeue();
if (item == null)
return null;
if (item.Incoming)
return item;
if (item.Sequence == 0)
return item;
if (contents.Remove(item.Sequence))
return item;
}
}
public void Cancel(uint sequence)
{
while(contents.Remove(sequence))
;
}
public void Flush()
@@ -286,6 +308,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TextureOutgoingPacketQueue.Clear();
AssetOutgoingPacketQueue.Clear();
SendQueue.Clear();
contents.Clear();
}
}