diff options
author | Justin Clark-Casey (justincc) | 2013-07-15 23:22:39 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-07-15 23:27:46 +0100 |
commit | 1b7b664c8696531fec26378d1386362d8a3da55e (patch) | |
tree | 1bdf9c56b647c7d5fa47289ec8323c4d35ae09ca /OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |
parent | Reinsert PhysicsActor variable back into SOP.SubscribeForCollisionEvents() in... (diff) | |
download | opensim-SC-1b7b664c8696531fec26378d1386362d8a3da55e.zip opensim-SC-1b7b664c8696531fec26378d1386362d8a3da55e.tar.gz opensim-SC-1b7b664c8696531fec26378d1386362d8a3da55e.tar.bz2 opensim-SC-1b7b664c8696531fec26378d1386362d8a3da55e.tar.xz |
Add request received/handling stats for caps which are served by http poll handlers.
This adds explicit cap poll handler supporting to the Caps classes rather than relying on callers to do the complicated coding.
Other refactoring was required to get logic into the right places to support this.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index b90df17..86a0298 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -77,7 +77,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
77 | 77 | ||
78 | private static WebFetchInvDescHandler m_webFetchHandler; | 78 | private static WebFetchInvDescHandler m_webFetchHandler; |
79 | 79 | ||
80 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); | ||
81 | private static Thread[] m_workerThreads = null; | 80 | private static Thread[] m_workerThreads = null; |
82 | 81 | ||
83 | private static DoubleQueue<aPollRequest> m_queue = | 82 | private static DoubleQueue<aPollRequest> m_queue = |
@@ -114,7 +113,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
114 | return; | 113 | return; |
115 | 114 | ||
116 | m_scene.EventManager.OnRegisterCaps -= RegisterCaps; | 115 | m_scene.EventManager.OnRegisterCaps -= RegisterCaps; |
117 | m_scene.EventManager.OnDeregisterCaps -= DeregisterCaps; | ||
118 | 116 | ||
119 | foreach (Thread t in m_workerThreads) | 117 | foreach (Thread t in m_workerThreads) |
120 | Watchdog.AbortThread(t.ManagedThreadId); | 118 | Watchdog.AbortThread(t.ManagedThreadId); |
@@ -134,7 +132,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
134 | m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); | 132 | m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); |
135 | 133 | ||
136 | m_scene.EventManager.OnRegisterCaps += RegisterCaps; | 134 | m_scene.EventManager.OnRegisterCaps += RegisterCaps; |
137 | m_scene.EventManager.OnDeregisterCaps += DeregisterCaps; | ||
138 | 135 | ||
139 | if (m_workerThreads == null) | 136 | if (m_workerThreads == null) |
140 | { | 137 | { |
@@ -177,8 +174,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
177 | 174 | ||
178 | private Scene m_scene; | 175 | private Scene m_scene; |
179 | 176 | ||
180 | public PollServiceInventoryEventArgs(Scene scene, UUID pId) : | 177 | public PollServiceInventoryEventArgs(Scene scene, string url, UUID pId) : |
181 | base(null, null, null, null, pId, int.MaxValue) | 178 | base(null, url, null, null, null, pId, int.MaxValue) |
182 | { | 179 | { |
183 | m_scene = scene; | 180 | m_scene = scene; |
184 | 181 | ||
@@ -308,40 +305,39 @@ namespace OpenSim.Region.ClientStack.Linden | |||
308 | if (m_fetchInventoryDescendents2Url == "") | 305 | if (m_fetchInventoryDescendents2Url == "") |
309 | return; | 306 | return; |
310 | 307 | ||
311 | string capUrl = "/CAPS/" + UUID.Random() + "/"; | ||
312 | |||
313 | // Register this as a poll service | 308 | // Register this as a poll service |
314 | PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, agentID); | 309 | PollServiceInventoryEventArgs args |
315 | 310 | = new PollServiceInventoryEventArgs(m_scene, "/CAPS/" + UUID.Random() + "/", agentID); | |
316 | args.Type = PollServiceEventArgs.EventType.Inventory; | 311 | args.Type = PollServiceEventArgs.EventType.Inventory; |
317 | MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | ||
318 | |||
319 | string hostName = m_scene.RegionInfo.ExternalHostName; | ||
320 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | ||
321 | string protocol = "http"; | ||
322 | |||
323 | if (MainServer.Instance.UseSSL) | ||
324 | { | ||
325 | hostName = MainServer.Instance.SSLCommonName; | ||
326 | port = MainServer.Instance.SSLPort; | ||
327 | protocol = "https"; | ||
328 | } | ||
329 | |||
330 | caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | ||
331 | 312 | ||
332 | m_capsDict[agentID] = capUrl; | 313 | caps.RegisterPollHandler("FetchInventoryDescendents2", args); |
314 | |||
315 | // MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); | ||
316 | // | ||
317 | // string hostName = m_scene.RegionInfo.ExternalHostName; | ||
318 | // uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | ||
319 | // string protocol = "http"; | ||
320 | // | ||
321 | // if (MainServer.Instance.UseSSL) | ||
322 | // { | ||
323 | // hostName = MainServer.Instance.SSLCommonName; | ||
324 | // port = MainServer.Instance.SSLPort; | ||
325 | // protocol = "https"; | ||
326 | // } | ||
327 | // | ||
328 | // caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); | ||
333 | } | 329 | } |
334 | 330 | ||
335 | private void DeregisterCaps(UUID agentID, Caps caps) | 331 | // private void DeregisterCaps(UUID agentID, Caps caps) |
336 | { | 332 | // { |
337 | string capUrl; | 333 | // string capUrl; |
338 | 334 | // | |
339 | if (m_capsDict.TryGetValue(agentID, out capUrl)) | 335 | // if (m_capsDict.TryGetValue(agentID, out capUrl)) |
340 | { | 336 | // { |
341 | MainServer.Instance.RemoveHTTPHandler("", capUrl); | 337 | // MainServer.Instance.RemoveHTTPHandler("", capUrl); |
342 | m_capsDict.Remove(agentID); | 338 | // m_capsDict.Remove(agentID); |
343 | } | 339 | // } |
344 | } | 340 | // } |
345 | 341 | ||
346 | private void DoInventoryRequests() | 342 | private void DoInventoryRequests() |
347 | { | 343 | { |
@@ -355,4 +351,4 @@ namespace OpenSim.Region.ClientStack.Linden | |||
355 | } | 351 | } |
356 | } | 352 | } |
357 | } | 353 | } |
358 | } | 354 | } \ No newline at end of file |