From 84492fee01d786cb28bed3a91148b1be9168a54a Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 17 Oct 2008 19:08:53 +0000 Subject: * Temporarily resume creation of IPEndPoint on every call * This widened what I think is an existing race condition where asynchronous recieves could potentially stomp on each other's end points (though this must occur very rarely, if at all, in reality) --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 2a907cc..26a77e4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -176,10 +176,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected virtual void OnReceivedData(IAsyncResult result) { Packet packet = null; - int numBytes = 1; - bool ok = false; + reusedEpSender = new IPEndPoint(IPAddress.Any, 0); try { @@ -451,9 +450,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // find the endpoint for this circuit EndPoint sendto; - try { + try + { sendto = (EndPoint)clientCircuits_reverse[circuitcode]; - } catch { + } + catch + { // Exceptions here mean there is no circuit m_log.Warn("[CLIENT]: Circuit not found, not sending packet"); return; @@ -525,7 +527,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (!clientCircuits.ContainsKey(userEP)) clientCircuits.Add(userEP, useCircuit.CircuitCode.Code); else - m_log.Error("[CLIENT]: clientCircuits already contans entry for user " + useCircuit.CircuitCode.Code + ". NOT adding."); + m_log.Error("[CLIENT]: clientCircuits already contains entry for user " + useCircuit.CircuitCode.Code + ". NOT adding."); } // This data structure is synchronized, so we don't need the lock -- cgit v1.1