* Stop creating a circuit if the client fails authentication (i.e. the region server wasn't told that it was coming)

* This moves authentication from the client thread (where failure was difficult to detect) to the particular thread handling that packet
* I've kept the authentication outside of the crucial clientCircuits lock (though any delay here is probably swamped by the other delays associated with login)
* Also added more to the unit test to ensure this doesn't regress
This commit is contained in:
Justin Clarke Casey
2008-10-24 21:22:54 +00:00
parent 71660003de
commit 3340a579e7
5 changed files with 110 additions and 69 deletions

View File

@@ -26,6 +26,7 @@
*/
using System.Net;
//using System.Threading;
using log4net;
using NUnit.Framework;
using OpenMetaverse;
@@ -69,8 +70,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
AgentCircuitManager acm = new AgentCircuitManager();
AgentCircuitData acd = new AgentCircuitData();
acd.AgentID = myAgentUuid;
acd.SessionID = mySessionUuid;
acm.AddNewCircuit(myCircuitCode, acd);
acd.SessionID = mySessionUuid;
uint port = 666;
testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm);
@@ -89,10 +89,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);
testLLUDPServer.LoadReceive(uccp, testEp);
testLLUDPServer.ReceiveData(null);
testLLUDPServer.ReceiveData(null);
Assert.IsFalse(testLLUDPServer.HasCircuit(101));
// Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet
Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode));
acm.AddNewCircuit(myCircuitCode, acd);
testLLUDPServer.LoadReceive(uccp, testEp);
testLLUDPServer.ReceiveData(null);
// Should succeed now
Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode));
Assert.IsFalse(testLLUDPServer.HasCircuit(101));
}
}
}