diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/PacketPool.cs | 9 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | using OpenMetaverse.Packets; | 32 | using OpenMetaverse.Packets; |
33 | using log4net; | ||
32 | 34 | ||
33 | namespace OpenSim.Framework | 35 | namespace 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 | ||