aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities
diff options
context:
space:
mode:
authorDiva Canto2015-05-08 08:37:31 -0700
committerDiva Canto2015-05-08 08:37:31 -0700
commit3110b1661f04a501cb6a9b8173bed516211a5827 (patch)
tree294b31a4c0ab086794d90c24a1a4d8d9c5c12479 /OpenSim/Capabilities
parentI shouldn't write code this early in the morning... Fixing a 'duh' on previou... (diff)
downloadopensim-SC-3110b1661f04a501cb6a9b8173bed516211a5827.zip
opensim-SC-3110b1661f04a501cb6a9b8173bed516211a5827.tar.gz
opensim-SC-3110b1661f04a501cb6a9b8173bed516211a5827.tar.bz2
opensim-SC-3110b1661f04a501cb6a9b8173bed516211a5827.tar.xz
Apparently Firestorm sometimes sends duplicate folder ids on the same request (see http://opensimulator.org/mantis/view.php?id=7054#c28297). This was throwing the new inventory download code off.
Firestorm also sends requests for folder UUID.Zero, which doesn't exist, but doesn't cause any problems either -- it just fails. I'm leaving the warning message for now, just to keep an eye on which folders can't be found, but may remove it in the future.
Diffstat (limited to 'OpenSim/Capabilities')
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
index e4ce1f3..27666f7 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
@@ -109,7 +109,9 @@ namespace OpenSim.Capabilities.Handlers
109 continue; 109 continue;
110 } 110 }
111 111
112 folders.Add(llsdRequest); 112 // Filter duplicate folder ids that bad viewers may send
113 if (folders.Find(f => f.folder_id == llsdRequest.folder_id) == null)
114 folders.Add(llsdRequest);
113 } 115 }
114 116
115 if (folders.Count > 0) 117 if (folders.Count > 0)
@@ -540,6 +542,8 @@ namespace OpenSim.Capabilities.Handlers
540 List<LLSDFetchInventoryDescendents> libfolders = fetchFolders.FindAll(f => f.owner_id == m_LibraryService.LibraryRootFolder.Owner); 542 List<LLSDFetchInventoryDescendents> libfolders = fetchFolders.FindAll(f => f.owner_id == m_LibraryService.LibraryRootFolder.Owner);
541 fetchFolders.RemoveAll(f => libfolders.Contains(f)); 543 fetchFolders.RemoveAll(f => libfolders.Contains(f));
542 544
545 //m_log.DebugFormat("[XXX]: Found {0} library folders in request", libfolders.Count);
546
543 foreach (LLSDFetchInventoryDescendents f in libfolders) 547 foreach (LLSDFetchInventoryDescendents f in libfolders)
544 { 548 {
545 if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) != null) 549 if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) != null)
@@ -553,7 +557,7 @@ namespace OpenSim.Capabilities.Handlers
553 ret.Collection.Version = fold.Version; 557 ret.Collection.Version = fold.Version;
554 558
555 ret.Descendents = ret.Collection.Items.Count; 559 ret.Descendents = ret.Collection.Items.Count;
556 560// m_log.DebugFormat("[XXX]: Added libfolder {0} ({1})", ret.Collection.FolderID, ret.Collection.OwnerID);
557 result.Add(ret); 561 result.Add(ret);
558 } 562 }
559 } 563 }
@@ -578,6 +582,8 @@ namespace OpenSim.Capabilities.Handlers
578 foreach (LLSDFetchInventoryDescendents f in fetchFolders) 582 foreach (LLSDFetchInventoryDescendents f in fetchFolders)
579 fids[i++] = f.folder_id; 583 fids[i++] = f.folder_id;
580 584
585 //m_log.DebugFormat("[XXX]: {0}", string.Join(",", fids));
586
581 InventoryCollection[] fetchedContents = m_InventoryService.GetMultipleFoldersContent(fetchFolders[0].owner_id, fids); 587 InventoryCollection[] fetchedContents = m_InventoryService.GetMultipleFoldersContent(fetchFolders[0].owner_id, fids);
582 588
583 if (fetchedContents == null || (fetchedContents != null && fetchedContents.Length == 0)) 589 if (fetchedContents == null || (fetchedContents != null && fetchedContents.Length == 0))