* 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)
0.6.0-stable
Justin Clarke Casey 2008-10-17 19:08:53 +00:00
parent 9e46d5e207
commit 84492fee01
1 changed files with 7 additions and 5 deletions

View File

@ -176,10 +176,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected virtual void OnReceivedData(IAsyncResult result) protected virtual void OnReceivedData(IAsyncResult result)
{ {
Packet packet = null; Packet packet = null;
int numBytes = 1; int numBytes = 1;
bool ok = false; bool ok = false;
reusedEpSender = new IPEndPoint(IPAddress.Any, 0);
try try
{ {
@ -451,9 +450,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
// find the endpoint for this circuit // find the endpoint for this circuit
EndPoint sendto; EndPoint sendto;
try { try
{
sendto = (EndPoint)clientCircuits_reverse[circuitcode]; sendto = (EndPoint)clientCircuits_reverse[circuitcode];
} catch { }
catch
{
// Exceptions here mean there is no circuit // Exceptions here mean there is no circuit
m_log.Warn("[CLIENT]: Circuit not found, not sending packet"); m_log.Warn("[CLIENT]: Circuit not found, not sending packet");
return; return;
@ -525,7 +527,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (!clientCircuits.ContainsKey(userEP)) if (!clientCircuits.ContainsKey(userEP))
clientCircuits.Add(userEP, useCircuit.CircuitCode.Code); clientCircuits.Add(userEP, useCircuit.CircuitCode.Code);
else 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 // This data structure is synchronized, so we don't need the lock