changing DropSend()'s foreach loop so that it does not copy the

LLQueItem m_NeedAck queue each time.
0.6.6-post-fixes
Dr Scofield 2009-06-25 07:59:47 +00:00
parent fa060a7282
commit e8e0ce5fc6
1 changed files with 11 additions and 5 deletions

View File

@ -741,16 +741,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void DropResend(Object id) private void DropResend(Object id)
{ {
foreach (LLQueItem data in new List<LLQueItem>(m_NeedAck.Values)) LLQueItem d = null;
foreach (LLQueItem data in m_NeedAck.Values)
{ {
if (data.Identifier != null && data.Identifier == id) if (data.Identifier != null && data.Identifier == id)
{ {
m_NeedAck.Remove(data.Packet.Header.Sequence); d = data;
m_PacketQueue.Cancel(data.Sequence); break;
PacketPool.Instance.ReturnPacket(data.Packet);
return;
} }
} }
if (null == d) return;
m_NeedAck.Remove(d.Packet.Header.Sequence);
m_PacketQueue.Cancel(d.Sequence);
PacketPool.Instance.ReturnPacket(d.Packet);
} }
private void TriggerOnPacketDrop(Packet packet, Object id) private void TriggerOnPacketDrop(Packet packet, Object id)