From 27dfdcf1fa38b12f86e414b1bbb09ea8ea966906 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 1 Dec 2018 18:50:53 +0000 Subject: [PATCH] clean a bit --- .../Linden/Caps/WebFetchInvDescModule.cs | 95 +------------------ 1 file changed, 5 insertions(+), 90 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index bae82a07e4..ca940b5580 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 public PollServiceInventoryEventArgs thepoll; public UUID reqID; public Hashtable request; - public ScenePresence presence; } private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -287,79 +286,16 @@ namespace OpenSim.Region.ClientStack.Linden Request = (x, y) => { - ScenePresence sp = m_module.Scene.GetScenePresence(Id); - APollRequest reqinfo = new APollRequest(); reqinfo.thepoll = this; reqinfo.reqID = x; reqinfo.request = y; - reqinfo.presence = sp; - -/* why where we doing this? just to get cof ? - List folders = new List(); - - // Decode the request here - string request = y["body"].ToString(); - - request = request.Replace("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); - - request = request.Replace("fetch_folders0", "fetch_folders0"); - request = request.Replace("fetch_folders1", "fetch_folders1"); - - Hashtable hash = new Hashtable(); - try - { - hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); - } - catch (LLSD.LLSDParseException e) - { - m_log.ErrorFormat("[INVENTORY]: Fetch error: {0}{1}" + e.Message, e.StackTrace); - m_log.Error("Request: " + request); - return; - } - catch (System.Xml.XmlException) - { - m_log.ErrorFormat("[INVENTORY]: XML Format error"); - } - - ArrayList foldersrequested = (ArrayList)hash["folders"]; - - bool highPriority = false; - - for (int i = 0; i < foldersrequested.Count; i++) - { - Hashtable inventoryhash = (Hashtable)foldersrequested[i]; - string folder = inventoryhash["folder_id"].ToString(); - UUID folderID; - if (UUID.TryParse(folder, out folderID)) - { - if (!folders.Contains(folderID)) - { - if (sp.COF != UUID.Zero && sp.COF == folderID) - highPriority = true; - folders.Add(folderID); - } - } - } - - if (highPriority) - m_queue.PriorityEnqueue(reqinfo); - else -*/ - m_queue.Add(reqinfo); + m_queue.Add(reqinfo); }; NoEvents = (x, y) => { -/* - lock (requests) - { - Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); - requests.Remove(request); - } -*/ Hashtable response = new Hashtable(); - response["int_response_code"] = 500; response["str_response_string"] = "Script timeout"; response["content_type"] = "text/plain"; @@ -376,7 +312,6 @@ namespace OpenSim.Region.ClientStack.Linden UUID requestID = requestinfo.reqID; - lock(responses) { lock(dropedResponses) @@ -394,9 +329,6 @@ namespace OpenSim.Region.ClientStack.Linden response["int_response_code"] = 200; response["content_type"] = "text/plain"; -// response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest( -// requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); - response["bin_response_data"] = System.Text.Encoding.UTF8.GetBytes( m_webFetchHandler.FetchInventoryDescendentsRequest( requestinfo.request["body"].ToString(), @@ -459,29 +391,14 @@ namespace OpenSim.Region.ClientStack.Linden else caps.RegisterHandler(capName, capUrl); } - - // m_log.DebugFormat( - // "[FETCH INVENTORY DESCENDENTS2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", - // capName, capUrl, m_scene.RegionInfo.RegionName, agentID); } -// private void DeregisterCaps(UUID agentID, Caps caps) -// { -// string capUrl; -// -// if (m_capsDict.TryGetValue(agentID, out capUrl)) -// { -// MainServer.Instance.RemoveHTTPHandler("", capUrl); -// m_capsDict.Remove(agentID); -// } -// } - private static void DoInventoryRequests() { - APollRequest poolreq; while (true) { - if(!m_queue.TryTake(out poolreq, 4500) || poolreq == null || poolreq.thepoll == null) + APollRequest poolreq; + if (!m_queue.TryTake(out poolreq, 4500) || poolreq == null || poolreq.thepoll == null) { Watchdog.UpdateThread(); continue; @@ -490,14 +407,12 @@ namespace OpenSim.Region.ClientStack.Linden Watchdog.UpdateThread(); try { - APollRequest req = poolreq; - req.thepoll.Process(req); + poolreq.thepoll.Process(poolreq); } catch (Exception e) { m_log.ErrorFormat( - "[INVENTORY]: Failed to process queued inventory request {0} for {1}. Exception {2}", - poolreq.reqID, poolreq.presence != null ? poolreq.presence.Name : "unknown", e); + "[INVENTORY]: Failed to process queued inventory Exception {0}", e.Message); } } }