aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
diff options
context:
space:
mode:
authorMelanie2013-07-24 03:50:09 +0100
committerMelanie2013-07-24 03:50:09 +0100
commita7eb1b5b855b3caa6c4622789ef1377830e2f435 (patch)
tree2bd58bcd2bd9b37adeb746f4b399b1d98539d1cf /OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
parentMerge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into ... (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-a7eb1b5b855b3caa6c4622789ef1377830e2f435.zip
opensim-SC-a7eb1b5b855b3caa6c4622789ef1377830e2f435.tar.gz
opensim-SC-a7eb1b5b855b3caa6c4622789ef1377830e2f435.tar.bz2
opensim-SC-a7eb1b5b855b3caa6c4622789ef1377830e2f435.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs67
1 files changed, 32 insertions, 35 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 27b09a6..f816ad3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -78,7 +78,6 @@ namespace OpenSim.Region.ClientStack.Linden
78 78
79 private static WebFetchInvDescHandler m_webFetchHandler; 79 private static WebFetchInvDescHandler m_webFetchHandler;
80 80
81 private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>();
82 private static Thread[] m_workerThreads = null; 81 private static Thread[] m_workerThreads = null;
83 82
84 private static DoubleQueue<aPollRequest> m_queue = 83 private static DoubleQueue<aPollRequest> m_queue =
@@ -115,7 +114,6 @@ namespace OpenSim.Region.ClientStack.Linden
115 return; 114 return;
116 115
117 m_scene.EventManager.OnRegisterCaps -= RegisterCaps; 116 m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
118 m_scene.EventManager.OnDeregisterCaps -= DeregisterCaps;
119 117
120 foreach (Thread t in m_workerThreads) 118 foreach (Thread t in m_workerThreads)
121 Watchdog.AbortThread(t.ManagedThreadId); 119 Watchdog.AbortThread(t.ManagedThreadId);
@@ -135,7 +133,6 @@ namespace OpenSim.Region.ClientStack.Linden
135 m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService); 133 m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
136 134
137 m_scene.EventManager.OnRegisterCaps += RegisterCaps; 135 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
138 m_scene.EventManager.OnDeregisterCaps += DeregisterCaps;
139 136
140 if (m_workerThreads == null) 137 if (m_workerThreads == null)
141 { 138 {
@@ -178,8 +175,8 @@ namespace OpenSim.Region.ClientStack.Linden
178 175
179 private Scene m_scene; 176 private Scene m_scene;
180 177
181 public PollServiceInventoryEventArgs(Scene scene, UUID pId) : 178 public PollServiceInventoryEventArgs(Scene scene, string url, UUID pId) :
182 base(null, null, null, null, pId, int.MaxValue) 179 base(null, url, null, null, null, pId, int.MaxValue)
183 { 180 {
184 m_scene = scene; 181 m_scene = scene;
185 182
@@ -310,40 +307,39 @@ namespace OpenSim.Region.ClientStack.Linden
310 if (m_fetchInventoryDescendents2Url == "") 307 if (m_fetchInventoryDescendents2Url == "")
311 return; 308 return;
312 309
313 string capUrl = "/CAPS/" + UUID.Random() + "/";
314
315 // Register this as a poll service 310 // Register this as a poll service
316 PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, agentID); 311 PollServiceInventoryEventArgs args
317 312 = new PollServiceInventoryEventArgs(m_scene, "/CAPS/" + UUID.Random() + "/", agentID);
318 args.Type = PollServiceEventArgs.EventType.Inventory; 313 args.Type = PollServiceEventArgs.EventType.Inventory;
319 MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
320
321 string hostName = m_scene.RegionInfo.ExternalHostName;
322 uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port;
323 string protocol = "http";
324
325 if (MainServer.Instance.UseSSL)
326 {
327 hostName = MainServer.Instance.SSLCommonName;
328 port = MainServer.Instance.SSLPort;
329 protocol = "https";
330 }
331
332 caps.RegisterHandler("FetchInventoryDescendents2", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
333 314
334 m_capsDict[agentID] = capUrl; 315 caps.RegisterPollHandler("FetchInventoryDescendents2", args);
316
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));
335 } 331 }
336 332
337 private void DeregisterCaps(UUID agentID, Caps caps) 333// private void DeregisterCaps(UUID agentID, Caps caps)
338 { 334// {
339 string capUrl; 335// string capUrl;
340 336//
341 if (m_capsDict.TryGetValue(agentID, out capUrl)) 337// if (m_capsDict.TryGetValue(agentID, out capUrl))
342 { 338// {
343 MainServer.Instance.RemoveHTTPHandler("", capUrl); 339// MainServer.Instance.RemoveHTTPHandler("", capUrl);
344 m_capsDict.Remove(agentID); 340// m_capsDict.Remove(agentID);
345 } 341// }
346 } 342// }
347 343
348 private void DoInventoryRequests() 344 private void DoInventoryRequests()
349 { 345 {
@@ -353,7 +349,8 @@ namespace OpenSim.Region.ClientStack.Linden
353 349
354 aPollRequest poolreq = m_queue.Dequeue(); 350 aPollRequest poolreq = m_queue.Dequeue();
355 351
356 poolreq.thepoll.Process(poolreq); 352 if (poolreq != null && poolreq.thepoll != null)
353 poolreq.thepoll.Process(poolreq);
357 } 354 }
358 } 355 }
359 } 356 }