aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Capabilities
diff options
context:
space:
mode:
authorDiva Canto2015-05-08 17:02:02 -0700
committerDiva Canto2015-05-08 17:02:02 -0700
commite5cf6a29fba650ef163f325c919417c35855aa2b (patch)
treec95d96d3b3e351837bb1056b5cd5b74d9cd353c0 /OpenSim/Capabilities
parentApparently Firestorm sometimes sends duplicate folder ids on the same request... (diff)
downloadopensim-SC_OLD-e5cf6a29fba650ef163f325c919417c35855aa2b.zip
opensim-SC_OLD-e5cf6a29fba650ef163f325c919417c35855aa2b.tar.gz
opensim-SC_OLD-e5cf6a29fba650ef163f325c919417c35855aa2b.tar.bz2
opensim-SC_OLD-e5cf6a29fba650ef163f325c919417c35855aa2b.tar.xz
Restore handling of bad folders. I'm not entirely sure this is part of the protocol -- I don't see it here: http://wiki.secondlife.com/wiki/Linden_Lab_Official:Inventory_API#Fetch_inventory_descendents
But who knows!
Diffstat (limited to 'OpenSim/Capabilities')
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs57
1 files changed, 48 insertions, 9 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
index 27666f7..b7f332d 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
@@ -116,8 +116,10 @@ namespace OpenSim.Capabilities.Handlers
116 116
117 if (folders.Count > 0) 117 if (folders.Count > 0)
118 { 118 {
119 List<InventoryCollectionWithDescendents> invcollSet = Fetch(folders); 119 List<UUID> bad_folders = new List<UUID>();
120 List<InventoryCollectionWithDescendents> invcollSet = Fetch(folders, bad_folders);
120 //m_log.DebugFormat("[XXX]: Got {0} folders from a request of {1}", invcollSet.Count, folders.Count); 121 //m_log.DebugFormat("[XXX]: Got {0} folders from a request of {1}", invcollSet.Count, folders.Count);
122
121 if (invcollSet == null) 123 if (invcollSet == null)
122 { 124 {
123 m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Multiple folder fetch failed. Trying old protocol."); 125 m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Multiple folder fetch failed. Trying old protocol.");
@@ -135,6 +137,10 @@ namespace OpenSim.Capabilities.Handlers
135 137
136 response += inventoryitemstr; 138 response += inventoryitemstr;
137 } 139 }
140
141 //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders));
142 foreach (UUID bad in bad_folders)
143 bad_folders_response += "<uuid>" + bad + "</uuid>";
138 } 144 }
139 145
140 if (response.Length == 0) 146 if (response.Length == 0)
@@ -161,8 +167,8 @@ namespace OpenSim.Capabilities.Handlers
161 } 167 }
162 } 168 }
163 169
164// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request"); 170 //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request for {0} folders. Item count {1}", folders.Count, item_count);
165// m_log.Debug("[WEB FETCH INV DESC HANDLER] "+response); 171 //m_log.Debug("[WEB FETCH INV DESC HANDLER] " + response);
166 172
167 return response; 173 return response;
168 174
@@ -557,14 +563,15 @@ namespace OpenSim.Capabilities.Handlers
557 ret.Collection.Version = fold.Version; 563 ret.Collection.Version = fold.Version;
558 564
559 ret.Descendents = ret.Collection.Items.Count; 565 ret.Descendents = ret.Collection.Items.Count;
560// m_log.DebugFormat("[XXX]: Added libfolder {0} ({1})", ret.Collection.FolderID, ret.Collection.OwnerID);
561 result.Add(ret); 566 result.Add(ret);
567
568 //m_log.DebugFormat("[XXX]: Added libfolder {0} ({1}) {2}", ret.Collection.FolderID, ret.Collection.OwnerID);
562 } 569 }
563 } 570 }
564 } 571 }
565 } 572 }
566 573
567 private List<InventoryCollectionWithDescendents> Fetch(List<LLSDFetchInventoryDescendents> fetchFolders) 574 private List<InventoryCollectionWithDescendents> Fetch(List<LLSDFetchInventoryDescendents> fetchFolders, List<UUID> bad_folders)
568 { 575 {
569 //m_log.DebugFormat( 576 //m_log.DebugFormat(
570 // "[WEB FETCH INV DESC HANDLER]: Fetching {0} folders for owner {1}", fetchFolders.Count, fetchFolders[0].owner_id); 577 // "[WEB FETCH INV DESC HANDLER]: Fetching {0} folders for owner {1}", fetchFolders.Count, fetchFolders[0].owner_id);
@@ -596,11 +603,15 @@ namespace OpenSim.Capabilities.Handlers
596 // Do some post-processing. May need to fetch more from inv server for links 603 // Do some post-processing. May need to fetch more from inv server for links
597 foreach (InventoryCollection contents in fetchedContents) 604 foreach (InventoryCollection contents in fetchedContents)
598 { 605 {
606 InventoryCollectionWithDescendents coll = new InventoryCollectionWithDescendents();
607 coll.Collection = contents;
608
599 if (contents == null) 609 if (contents == null)
610 {
611 bad_folders.Add(fids[i++]);
600 continue; 612 continue;
613 }
601 614
602 InventoryCollectionWithDescendents coll = new InventoryCollectionWithDescendents();
603 coll.Collection = contents;
604 615
605 // Find the original request 616 // Find the original request
606 LLSDFetchInventoryDescendents freq = fetchFolders[i++]; 617 LLSDFetchInventoryDescendents freq = fetchFolders[i++];
@@ -622,8 +633,36 @@ namespace OpenSim.Capabilities.Handlers
622 } 633 }
623 else 634 else
624 { 635 {
625 m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Unable to fetch folder {0}", freq.folder_id); 636 // Was it really a request for folder Zero?
626 continue; 637 // This is an overkill, but Firestorm really asks for folder Zero.
638 // I'm leaving the code here for the time being, but commented.
639 if (fetchFolders[i - 1].folder_id == UUID.Zero)
640 {
641 //coll.Collection.OwnerID = freq.owner_id;
642 //coll.Collection.FolderID = contents.FolderID;
643 //containingFolder = m_InventoryService.GetRootFolder(freq.owner_id);
644 //if (containingFolder != null)
645 //{
646 // m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Request for parent of folder {0}", containingFolder.ID);
647 // coll.Collection.Folders.Clear();
648 // coll.Collection.Folders.Add(containingFolder);
649 // if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null)
650 // {
651 // InventoryFolderBase lib = new InventoryFolderBase(m_LibraryService.LibraryRootFolder.ID, m_LibraryService.LibraryRootFolder.Owner);
652 // lib.Name = m_LibraryService.LibraryRootFolder.Name;
653 // lib.Type = m_LibraryService.LibraryRootFolder.Type;
654 // lib.Version = m_LibraryService.LibraryRootFolder.Version;
655 // coll.Collection.Folders.Add(lib);
656 // }
657 // coll.Collection.Items.Clear();
658 //}
659 }
660 else
661 {
662 m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Unable to fetch folder {0}", freq.folder_id);
663 bad_folders.Add(freq.folder_id);
664 continue;
665 }
627 } 666 }
628 } 667 }
629 668