From c934901a056f142c49e6b449971fcaf59ff19d82 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 3 Dec 2011 16:11:47 +0000 Subject: Use GetAgentCircuits() to receive a copy of the AgentCircuitsByUUID dictionary rather than AgentCircuitManager.AgentCircuits directly in "show circuits" to avoid enumeration exceptions --- OpenSim/Region/Application/OpenSim.cs | 2 +- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4b38a2e..8d98cc9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -1039,7 +1039,7 @@ namespace OpenSim { //this.HttpServer. acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); - foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.AgentCircuits.Values) + foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root")); } ); diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index f6a3d1f..57d22bd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs @@ -103,15 +103,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null); - Assert.That(scene.AuthenticateHandler.AgentCircuits.Count, Is.EqualTo(1)); - Assert.That(scene.AuthenticateHandler.AgentCircuitsByUUID.Count, Is.EqualTo(1)); + Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); scene.IncomingCloseAgent(sp.UUID); Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); - Assert.That(scene.AuthenticateHandler.AgentCircuits.Count, Is.EqualTo(0)); - Assert.That(scene.AuthenticateHandler.AgentCircuitsByUUID.Count, Is.EqualTo(0)); + Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0)); } /// -- cgit v1.1