aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/PacketPool.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs
index 9994fac..a4f7d96 100644
--- a/OpenSim/Framework/PacketPool.cs
+++ b/OpenSim/Framework/PacketPool.cs
@@ -27,13 +27,17 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
30using OpenMetaverse; 31using OpenMetaverse;
31using OpenMetaverse.Packets; 32using OpenMetaverse.Packets;
33using log4net;
32 34
33namespace OpenSim.Framework 35namespace OpenSim.Framework
34{ 36{
35 public sealed class PacketPool 37 public sealed class PacketPool
36 { 38 {
39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40
37 private static readonly PacketPool instance = new PacketPool(); 41 private static readonly PacketPool instance = new PacketPool();
38 42
39 private bool packetPoolEnabled = false; 43 private bool packetPoolEnabled = false;
@@ -119,7 +123,10 @@ namespace OpenSim.Framework
119 123
120 int i = 0; 124 int i = 0;
121 Packet packet = GetPacket(type); 125 Packet packet = GetPacket(type);
122 packet.FromBytes(bytes, ref i, ref packetEnd, zeroBuffer); 126 if (packet == null)
127 m_log.WarnFormat("[PACKETPOOL]: Failed to get packet of type {0}", type);
128 else
129 packet.FromBytes(bytes, ref i, ref packetEnd, zeroBuffer);
123 return packet; 130 return packet;
124 } 131 }
125 132