aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-24 23:16:03 +0100
committerJustin Clark-Casey (justincc)2011-10-24 23:16:03 +0100
commit9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7 (patch)
tree6a91df6f558370682a0a3c0f7c9a59ff85302d3e /OpenSim/Region/ClientStack
parentseparate out future common setup code from EventQueueTests.AddForClient() (diff)
downloadopensim-SC_OLD-9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7.zip
opensim-SC_OLD-9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7.tar.gz
opensim-SC_OLD-9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7.tar.bz2
opensim-SC_OLD-9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7.tar.xz
Fix bugs in EventQueueGetModule.ClientClosed() and BaseHttpServer.RemovePollServerHTTPHandler() that stopped existing code in ClientClosed() from actually tearing down the poll handler
Actually doing the tear down appear to have no ill effects with region crossing and teleport.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs15
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