From 5320f0f33ce08e5fdd0380ea3bfd3e0fb00bae8e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 17 Dec 2008 20:21:48 +0000 Subject: Stop packets that may be resent from being returned to the packet pool. FWIW --- OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 83e77b7..4964efc 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -370,6 +370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_NeedAck.Remove(packet.Header.Sequence); TriggerOnPacketDrop(packet, data.Identifier); + PacketPool.Instance.ReturnPacket(packet); continue; } @@ -625,6 +626,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return; m_NeedAck.Remove(id); + PacketPool.Instance.ReturnPacket(data.Packet); m_UnackedBytes -= data.Length; } } @@ -735,6 +737,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (data.Identifier != null && data.Identifier == id) { m_NeedAck.Remove(data.Packet.Header.Sequence); + PacketPool.Instance.ReturnPacket(data.Packet); return; } } @@ -804,7 +807,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode); } - PacketPool.Instance.ReturnPacket(packet); + // 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); } private void Abort() -- cgit v1.1