Stop packets that may be resent from being returned to the packet pool.

FWIW
0.6.1-post-fixes
Melanie Thielker 2008-12-17 20:21:48 +00:00
parent 2108d328df
commit 5320f0f33c
1 changed files with 8 additions and 1 deletions

View File

@ -370,6 +370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
m_NeedAck.Remove(packet.Header.Sequence); m_NeedAck.Remove(packet.Header.Sequence);
TriggerOnPacketDrop(packet, data.Identifier); TriggerOnPacketDrop(packet, data.Identifier);
PacketPool.Instance.ReturnPacket(packet);
continue; continue;
} }
@ -625,6 +626,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return; return;
m_NeedAck.Remove(id); m_NeedAck.Remove(id);
PacketPool.Instance.ReturnPacket(data.Packet);
m_UnackedBytes -= data.Length; m_UnackedBytes -= data.Length;
} }
} }
@ -735,6 +737,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (data.Identifier != null && data.Identifier == id) if (data.Identifier != null && data.Identifier == id)
{ {
m_NeedAck.Remove(data.Packet.Header.Sequence); m_NeedAck.Remove(data.Packet.Header.Sequence);
PacketPool.Instance.ReturnPacket(data.Packet);
return; return;
} }
} }
@ -804,6 +807,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode); sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode);
} }
// If this is a reliable packet, we are still holding a ref
// Dont't return in that case
//
if (!packet.Header.Reliable)
PacketPool.Instance.ReturnPacket(packet); PacketPool.Instance.ReturnPacket(packet);
} }