diff options
author | Justin Clarke Casey | 2008-10-24 21:22:54 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-24 21:22:54 +0000 |
commit | 3340a579e72f1248bb092a705db068027e46ef75 (patch) | |
tree | de14319e2adc598dff0fd7557fc4f9d807ac55a2 /OpenSim/Region/ClientStack/LindenUDP/Tests | |
parent | un-double-flipped some double-flipped normals in circular path prim end caps (diff) | |
download | opensim-SC_OLD-3340a579e72f1248bb092a705db068027e46ef75.zip opensim-SC_OLD-3340a579e72f1248bb092a705db068027e46ef75.tar.gz opensim-SC_OLD-3340a579e72f1248bb092a705db068027e46ef75.tar.bz2 opensim-SC_OLD-3340a579e72f1248bb092a705db068027e46ef75.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/Tests')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs index c90aecf..819e4e8 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Net; | 28 | using System.Net; |
29 | //using System.Threading; | ||
29 | using log4net; | 30 | using log4net; |
30 | using NUnit.Framework; | 31 | using NUnit.Framework; |
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
@@ -69,8 +70,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
69 | AgentCircuitManager acm = new AgentCircuitManager(); | 70 | AgentCircuitManager acm = new AgentCircuitManager(); |
70 | AgentCircuitData acd = new AgentCircuitData(); | 71 | AgentCircuitData acd = new AgentCircuitData(); |
71 | acd.AgentID = myAgentUuid; | 72 | acd.AgentID = myAgentUuid; |
72 | acd.SessionID = mySessionUuid; | 73 | acd.SessionID = mySessionUuid; |
73 | acm.AddNewCircuit(myCircuitCode, acd); | ||
74 | 74 | ||
75 | uint port = 666; | 75 | uint port = 666; |
76 | testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm); | 76 | testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm); |
@@ -89,10 +89,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
89 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); | 89 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); |
90 | 90 | ||
91 | testLLUDPServer.LoadReceive(uccp, testEp); | 91 | testLLUDPServer.LoadReceive(uccp, testEp); |
92 | testLLUDPServer.ReceiveData(null); | 92 | testLLUDPServer.ReceiveData(null); |
93 | 93 | ||
94 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | 94 | // Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet |
95 | Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); | ||
96 | |||
97 | acm.AddNewCircuit(myCircuitCode, acd); | ||
98 | |||
99 | testLLUDPServer.LoadReceive(uccp, testEp); | ||
100 | testLLUDPServer.ReceiveData(null); | ||
101 | |||
102 | // Should succeed now | ||
95 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); | 103 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); |
104 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | ||
96 | } | 105 | } |
97 | } | 106 | } |
98 | } | 107 | } |