diff options
author | Melanie | 2011-10-25 03:26:44 +0100 |
---|---|---|
committer | Melanie | 2011-10-25 03:26:44 +0100 |
commit | c8dfef15834b793dcffd3951ca4a86d68e5c9b45 (patch) | |
tree | 9e3df381662bfe781ad479c145d9e8e839c42a2b /OpenSim/Region | |
parent | Merge commit '79d5bc9beb445ca07cff9ecbd91d89b2a57e14da' into bigmerge (diff) | |
parent | Fix bugs in EventQueueGetModule.ClientClosed() and BaseHttpServer.RemovePollS... (diff) | |
download | opensim-SC-c8dfef15834b793dcffd3951ca4a86d68e5c9b45.zip opensim-SC-c8dfef15834b793dcffd3951ca4a86d68e5c9b45.tar.gz opensim-SC-c8dfef15834b793dcffd3951ca4a86d68e5c9b45.tar.bz2 opensim-SC-c8dfef15834b793dcffd3951ca4a86d68e5c9b45.tar.xz |
Merge commit '9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7' into bigmerge
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | 15 |
2 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 3eb2b5e..7d73b3e 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -204,7 +204,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
204 | 204 | ||
205 | private void ClientClosed(UUID AgentID, Scene scene) | 205 | private void ClientClosed(UUID AgentID, Scene scene) |
206 | { | 206 | { |
207 | //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); | 207 | // m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); |
208 | 208 | ||
209 | int count = 0; | 209 | int count = 0; |
210 | while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5) | 210 | while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5) |
@@ -216,11 +216,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
216 | { | 216 | { |
217 | queues.Remove(AgentID); | 217 | queues.Remove(AgentID); |
218 | } | 218 | } |
219 | |||
219 | List<UUID> removeitems = new List<UUID>(); | 220 | List<UUID> removeitems = new List<UUID>(); |
220 | lock (m_AvatarQueueUUIDMapping) | 221 | lock (m_AvatarQueueUUIDMapping) |
221 | { | 222 | { |
222 | foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys) | 223 | foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys) |
223 | { | 224 | { |
225 | // m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID); | ||
224 | if (ky == AgentID) | 226 | if (ky == AgentID) |
225 | { | 227 | { |
226 | removeitems.Add(ky); | 228 | removeitems.Add(ky); |
@@ -229,11 +231,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
229 | 231 | ||
230 | foreach (UUID ky in removeitems) | 232 | foreach (UUID ky in removeitems) |
231 | { | 233 | { |
234 | UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky]; | ||
232 | m_AvatarQueueUUIDMapping.Remove(ky); | 235 | m_AvatarQueueUUIDMapping.Remove(ky); |
233 | MainServer.Instance.RemovePollServiceHTTPHandler("","/CAPS/EQG/" + ky.ToString() + "/"); | ||
234 | } | ||
235 | 236 | ||
237 | MainServer.Instance.RemovePollServiceHTTPHandler("","/CAPS/EQG/" + eventQueueGetUuid.ToString() + "/"); | ||
238 | } | ||
236 | } | 239 | } |
240 | |||
237 | UUID searchval = UUID.Zero; | 241 | UUID searchval = UUID.Zero; |
238 | 242 | ||
239 | removeitems.Clear(); | 243 | removeitems.Clear(); |
@@ -252,7 +256,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
252 | 256 | ||
253 | foreach (UUID ky in removeitems) | 257 | foreach (UUID ky in removeitems) |
254 | m_QueueUUIDAvatarMapping.Remove(ky); | 258 | m_QueueUUIDAvatarMapping.Remove(ky); |
255 | |||
256 | } | 259 | } |
257 | } | 260 | } |
258 | 261 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index ec8a414..2ca02c5 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | |||
@@ -74,5 +74,20 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
74 | // TODO: Add more assertions for the other aspects of event queues | 74 | // TODO: Add more assertions for the other aspects of event queues |
75 | Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(1)); | 75 | Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(1)); |
76 | } | 76 | } |
77 | |||
78 | [Test] | ||
79 | public void RemoveForClient() | ||
80 | { | ||
81 | TestHelpers.InMethod(); | ||
82 | // log4net.Config.XmlConfigurator.Configure(); | ||
83 | |||
84 | UUID spId = TestHelpers.ParseTail(0x1); | ||
85 | |||
86 | SceneHelpers.AddScenePresence(m_scene, spId); | ||
87 | m_scene.IncomingCloseAgent(spId); | ||
88 | |||
89 | // TODO: Add more assertions for the other aspects of event queues | ||
90 | Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(0)); | ||
91 | } | ||
77 | } | 92 | } |
78 | } \ No newline at end of file | 93 | } \ No newline at end of file |