From dba779862d4b5e092bc5fc717cafb2a13f005368 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 3 Sep 2008 11:25:11 +0000 Subject: Mantis #2107 Thank you, lulurun, for a patch to fix a possible crash when a received packet contains a quaternion with all members zeroed. --- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 3071110..94f7214 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -389,12 +389,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP if ((q.Count == 0) && (throttle.UnderLimit())) { - Monitor.Enter(this); - throttle.Add(item.Packet.ToBytes().Length); - TotalThrottle.Add(item.Packet.ToBytes().Length); - SendQueue.Enqueue(item); - Monitor.Pulse(this); - Monitor.Exit(this); + try + { + Monitor.Enter(this); + throttle.Add(item.Packet.ToBytes().Length); + TotalThrottle.Add(item.Packet.ToBytes().Length); + SendQueue.Enqueue(item); + } + catch (Exception e) + { + // Probably a serialization exception + m_log.WarnFormat("ThrottleCheck: {0}", e.ToString()); + } + finally + { + Monitor.Pulse(this); + Monitor.Exit(this); + } } else { -- cgit v1.1