aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-07-16 00:05:45 +0100
committerJustin Clark-Casey (justincc)2013-07-16 00:05:45 +0100
commite8e073aa97a8f756f42b242dd1cfcd05beb4d8ef (patch)
tree6a029db31677dd2034ac03889722cdcc9d1ec336 /OpenSim/Region/ClientStack/Linden/Caps
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-e8e073aa97a8f756f42b242dd1cfcd05beb4d8ef.zip
opensim-SC_OLD-e8e073aa97a8f756f42b242dd1cfcd05beb4d8ef.tar.gz
opensim-SC_OLD-e8e073aa97a8f756f42b242dd1cfcd05beb4d8ef.tar.bz2
opensim-SC_OLD-e8e073aa97a8f756f42b242dd1cfcd05beb4d8ef.tar.xz
Simplify EventQueue cap setup so that it is also stat monitored.
Curiously, the number of requests received is always one greater than that shown as handled - needs investigation
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs74
1 files changed, 29 insertions, 45 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index ca38a97..1835a72 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -252,29 +252,32 @@ namespace OpenSim.Region.ClientStack.Linden
252 252
253 List<UUID> removeitems = new List<UUID>(); 253 List<UUID> removeitems = new List<UUID>();
254 lock (m_AvatarQueueUUIDMapping) 254 lock (m_AvatarQueueUUIDMapping)
255 { 255 m_AvatarQueueUUIDMapping.Remove(agentID);
256 foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys)
257 {
258// m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID);
259 if (ky == agentID)
260 {
261 removeitems.Add(ky);
262 }
263 }
264 256
265 foreach (UUID ky in removeitems) 257// lock (m_AvatarQueueUUIDMapping)
266 { 258// {
267 UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky]; 259// foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys)
268 m_AvatarQueueUUIDMapping.Remove(ky); 260// {
269 261//// m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID);
270 string eqgPath = GenerateEqgCapPath(eventQueueGetUuid); 262// if (ky == agentID)
271 MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath); 263// {
272 264// removeitems.Add(ky);
273// m_log.DebugFormat( 265// }
274// "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}", 266// }
275// eqgPath, agentID, m_scene.RegionInfo.RegionName); 267//
276 } 268// foreach (UUID ky in removeitems)
277 } 269// {
270// UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky];
271// m_AvatarQueueUUIDMapping.Remove(ky);
272//
273// string eqgPath = GenerateEqgCapPath(eventQueueGetUuid);
274// MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath);
275//
276//// m_log.DebugFormat(
277//// "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}",
278//// eqgPath, agentID, m_scene.RegionInfo.RegionName);
279// }
280// }
278 281
279 UUID searchval = UUID.Zero; 282 UUID searchval = UUID.Zero;
280 283
@@ -359,29 +362,10 @@ namespace OpenSim.Region.ClientStack.Linden
359 m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID); 362 m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID);
360 } 363 }
361 364
362 string eventQueueGetPath = GenerateEqgCapPath(eventQueueGetUUID); 365 caps.RegisterPollHandler(
363 366 "EventQueueGet",
364 // Register this as a caps handler 367 new PollServiceEventArgs(
365 // FIXME: Confusingly, we need to register separate as a capability so that the client is told about 368 null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, 40000));
366 // EventQueueGet when it receive capability information, but then we replace the rest handler immediately
367 // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but
368 // really it should be possible to directly register the poll handler as a capability.
369 caps.RegisterHandler(
370 "EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null, "EventQueueGet", null));
371// delegate(Hashtable m_dhttpMethod)
372// {
373// return ProcessQueue(m_dhttpMethod, agentID, caps);
374// }));
375
376 // This will persist this beyond the expiry of the caps handlers
377 // TODO: Add EventQueueGet name/description for diagnostics
378 MainServer.Instance.AddPollServiceHTTPHandler(
379 eventQueueGetPath,
380 new PollServiceEventArgs(null, eventQueueGetPath, HasEvents, GetEvents, NoEvents, agentID, 40000));
381
382// m_log.DebugFormat(
383// "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}",
384// eventQueueGetPath, agentID, m_scene.RegionInfo.RegionName);
385 369
386 Random rnd = new Random(Environment.TickCount); 370 Random rnd = new Random(Environment.TickCount);
387 lock (m_ids) 371 lock (m_ids)