From f0ffbf5b38ad0cea3c906902e262d3c77e201475 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 22 Aug 2008 21:41:05 +0000 Subject: * Allow an exception generated in ProcessOutPacket to travel up the stack * It is dealt with correctly further up, at which point the user is also notified and the failure recorded as a statistic --- .../ClientStack/LindenUDP/LLPacketHandler.cs | 43 ++++++++-------------- 1 file changed, 16 insertions(+), 27 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 11cfbd9..209ec36 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -745,37 +745,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP } // Actually make the byte array and send it - try - { - byte[] sendbuffer = packet.ToBytes(); + byte[] sendbuffer = packet.ToBytes(); - if (packet.Header.Zerocoded) - { - int packetsize = Helpers.ZeroEncode(sendbuffer, - sendbuffer.Length, m_ZeroOutBuffer); - m_PacketServer.SendPacketTo(m_ZeroOutBuffer, packetsize, - SocketFlags.None, m_Client.CircuitCode); - } - else - { - // Need some extra space in case we need to add proxy - // information to the message later - Buffer.BlockCopy(sendbuffer, 0, m_ZeroOutBuffer, 0, - sendbuffer.Length); - m_PacketServer.SendPacketTo(m_ZeroOutBuffer, - sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode); - } - - PacketPool.Instance.ReturnPacket(packet); + if (packet.Header.Zerocoded) + { + int packetsize = Helpers.ZeroEncode(sendbuffer, + sendbuffer.Length, m_ZeroOutBuffer); + m_PacketServer.SendPacketTo(m_ZeroOutBuffer, packetsize, + SocketFlags.None, m_Client.CircuitCode); } - catch (Exception e) + else { - m_log.Warn("[client]: " + - "PacketHandler:ProcessOutPacket() - WARNING: Socket "+ - "exception occurred - killing thread"); - m_log.Error(e.ToString()); - m_Client.Close(true); + // Need some extra space in case we need to add proxy + // information to the message later + Buffer.BlockCopy(sendbuffer, 0, m_ZeroOutBuffer, 0, + sendbuffer.Length); + m_PacketServer.SendPacketTo(m_ZeroOutBuffer, + sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode); } + + PacketPool.Instance.ReturnPacket(packet); } } } -- cgit v1.1