* 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 statistic0.6.0-stable
parent
d972d22788
commit
f0ffbf5b38
|
@ -745,37 +745,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually make the byte array and send it
|
// Actually make the byte array and send it
|
||||||
try
|
byte[] sendbuffer = packet.ToBytes();
|
||||||
{
|
|
||||||
byte[] sendbuffer = packet.ToBytes();
|
|
||||||
|
|
||||||
if (packet.Header.Zerocoded)
|
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);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
{
|
||||||
m_log.Warn("[client]: " +
|
int packetsize = Helpers.ZeroEncode(sendbuffer,
|
||||||
"PacketHandler:ProcessOutPacket() - WARNING: Socket "+
|
sendbuffer.Length, m_ZeroOutBuffer);
|
||||||
"exception occurred - killing thread");
|
m_PacketServer.SendPacketTo(m_ZeroOutBuffer, packetsize,
|
||||||
m_log.Error(e.ToString());
|
SocketFlags.None, m_Client.CircuitCode);
|
||||||
m_Client.Close(true);
|
|
||||||
}
|
}
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue