diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 95 |
1 files changed, 5 insertions, 90 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index bae82a0..ca940b5 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -59,7 +59,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
59 | public PollServiceInventoryEventArgs thepoll; | 59 | public PollServiceInventoryEventArgs thepoll; |
60 | public UUID reqID; | 60 | public UUID reqID; |
61 | public Hashtable request; | 61 | public Hashtable request; |
62 | public ScenePresence presence; | ||
63 | } | 62 | } |
64 | 63 | ||
65 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 64 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -287,79 +286,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
287 | 286 | ||
288 | Request = (x, y) => | 287 | Request = (x, y) => |
289 | { | 288 | { |
290 | ScenePresence sp = m_module.Scene.GetScenePresence(Id); | ||
291 | |||
292 | APollRequest reqinfo = new APollRequest(); | 289 | APollRequest reqinfo = new APollRequest(); |
293 | reqinfo.thepoll = this; | 290 | reqinfo.thepoll = this; |
294 | reqinfo.reqID = x; | 291 | reqinfo.reqID = x; |
295 | reqinfo.request = y; | 292 | reqinfo.request = y; |
296 | reqinfo.presence = sp; | 293 | m_queue.Add(reqinfo); |
297 | |||
298 | /* why where we doing this? just to get cof ? | ||
299 | List<UUID> folders = new List<UUID>(); | ||
300 | |||
301 | // Decode the request here | ||
302 | string request = y["body"].ToString(); | ||
303 | |||
304 | request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>"); | ||
305 | |||
306 | request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>"); | ||
307 | request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>"); | ||
308 | |||
309 | Hashtable hash = new Hashtable(); | ||
310 | try | ||
311 | { | ||
312 | hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); | ||
313 | } | ||
314 | catch (LLSD.LLSDParseException e) | ||
315 | { | ||
316 | m_log.ErrorFormat("[INVENTORY]: Fetch error: {0}{1}" + e.Message, e.StackTrace); | ||
317 | m_log.Error("Request: " + request); | ||
318 | return; | ||
319 | } | ||
320 | catch (System.Xml.XmlException) | ||
321 | { | ||
322 | m_log.ErrorFormat("[INVENTORY]: XML Format error"); | ||
323 | } | ||
324 | |||
325 | ArrayList foldersrequested = (ArrayList)hash["folders"]; | ||
326 | |||
327 | bool highPriority = false; | ||
328 | |||
329 | for (int i = 0; i < foldersrequested.Count; i++) | ||
330 | { | ||
331 | Hashtable inventoryhash = (Hashtable)foldersrequested[i]; | ||
332 | string folder = inventoryhash["folder_id"].ToString(); | ||
333 | UUID folderID; | ||
334 | if (UUID.TryParse(folder, out folderID)) | ||
335 | { | ||
336 | if (!folders.Contains(folderID)) | ||
337 | { | ||
338 | if (sp.COF != UUID.Zero && sp.COF == folderID) | ||
339 | highPriority = true; | ||
340 | folders.Add(folderID); | ||
341 | } | ||
342 | } | ||
343 | } | ||
344 | |||
345 | if (highPriority) | ||
346 | m_queue.PriorityEnqueue(reqinfo); | ||
347 | else | ||
348 | */ | ||
349 | m_queue.Add(reqinfo); | ||
350 | }; | 294 | }; |
351 | 295 | ||
352 | NoEvents = (x, y) => | 296 | NoEvents = (x, y) => |
353 | { | 297 | { |
354 | /* | ||
355 | lock (requests) | ||
356 | { | ||
357 | Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); | ||
358 | requests.Remove(request); | ||
359 | } | ||
360 | */ | ||
361 | Hashtable response = new Hashtable(); | 298 | Hashtable response = new Hashtable(); |
362 | |||
363 | response["int_response_code"] = 500; | 299 | response["int_response_code"] = 500; |
364 | response["str_response_string"] = "Script timeout"; | 300 | response["str_response_string"] = "Script timeout"; |
365 | response["content_type"] = "text/plain"; | 301 | response["content_type"] = "text/plain"; |
@@ -376,7 +312,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
376 | 312 | ||
377 | UUID requestID = requestinfo.reqID; | 313 | UUID requestID = requestinfo.reqID; |
378 | 314 | ||
379 | |||
380 | lock(responses) | 315 | lock(responses) |
381 | { | 316 | { |
382 | lock(dropedResponses) | 317 | lock(dropedResponses) |
@@ -394,9 +329,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
394 | response["int_response_code"] = 200; | 329 | response["int_response_code"] = 200; |
395 | response["content_type"] = "text/plain"; | 330 | response["content_type"] = "text/plain"; |
396 | 331 | ||
397 | // response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest( | ||
398 | // requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); | ||
399 | |||
400 | response["bin_response_data"] = System.Text.Encoding.UTF8.GetBytes( | 332 | response["bin_response_data"] = System.Text.Encoding.UTF8.GetBytes( |
401 | m_webFetchHandler.FetchInventoryDescendentsRequest( | 333 | m_webFetchHandler.FetchInventoryDescendentsRequest( |
402 | requestinfo.request["body"].ToString(), | 334 | requestinfo.request["body"].ToString(), |
@@ -459,29 +391,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
459 | else | 391 | else |
460 | caps.RegisterHandler(capName, capUrl); | 392 | caps.RegisterHandler(capName, capUrl); |
461 | } | 393 | } |
462 | |||
463 | // m_log.DebugFormat( | ||
464 | // "[FETCH INVENTORY DESCENDENTS2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", | ||
465 | // capName, capUrl, m_scene.RegionInfo.RegionName, agentID); | ||
466 | } | 394 | } |
467 | 395 | ||
468 | // private void DeregisterCaps(UUID agentID, Caps caps) | ||
469 | // { | ||
470 | // string capUrl; | ||
471 | // | ||
472 | // if (m_capsDict.TryGetValue(agentID, out capUrl)) | ||
473 | // { | ||
474 | // MainServer.Instance.RemoveHTTPHandler("", capUrl); | ||
475 | // m_capsDict.Remove(agentID); | ||
476 | // } | ||
477 | // } | ||
478 | |||
479 | private static void DoInventoryRequests() | 396 | private static void DoInventoryRequests() |
480 | { | 397 | { |
481 | APollRequest poolreq; | ||
482 | while (true) | 398 | while (true) |
483 | { | 399 | { |
484 | if(!m_queue.TryTake(out poolreq, 4500) || poolreq == null || poolreq.thepoll == null) | 400 | APollRequest poolreq; |
401 | if (!m_queue.TryTake(out poolreq, 4500) || poolreq == null || poolreq.thepoll == null) | ||
485 | { | 402 | { |
486 | Watchdog.UpdateThread(); | 403 | Watchdog.UpdateThread(); |
487 | continue; | 404 | continue; |
@@ -490,14 +407,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
490 | Watchdog.UpdateThread(); | 407 | Watchdog.UpdateThread(); |
491 | try | 408 | try |
492 | { | 409 | { |
493 | APollRequest req = poolreq; | 410 | poolreq.thepoll.Process(poolreq); |
494 | req.thepoll.Process(req); | ||
495 | } | 411 | } |
496 | catch (Exception e) | 412 | catch (Exception e) |
497 | { | 413 | { |
498 | m_log.ErrorFormat( | 414 | m_log.ErrorFormat( |
499 | "[INVENTORY]: Failed to process queued inventory request {0} for {1}. Exception {2}", | 415 | "[INVENTORY]: Failed to process queued inventory Exception {0}", e.Message); |
500 | poolreq.reqID, poolreq.presence != null ? poolreq.presence.Name : "unknown", e); | ||
501 | } | 416 | } |
502 | } | 417 | } |
503 | } | 418 | } |