diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 2dc2374720..d94ff6c250 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -293,64 +293,73 @@ namespace OpenSim.Framework.Communications.Cache folderID, remoteClient.Name); } + /// + /// Handle the caps inventory descendents fetch. + /// + /// Since the folder structure is sent to the client on login, I believe we only need to handle items. + /// + /// + /// + /// + /// + /// + /// + /// public List HandleFetchInventoryDescendentsCAPS(LLUUID agentID, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) { // XXX We're not handling sortOrder yet! - // with CAPS we are only return items in the folders at the moment - // need to find the format that sub folder details are sent in - // if (fetchItems) - // { - InventoryFolderImpl fold = null; - if (folderID == libraryRoot.ID) - { - return libraryRoot.RequestListOfItems(); - } - if ((fold = libraryRoot.HasSubFolder(folderID)) != null) - { - return fold.RequestListOfItems(); - } + InventoryFolderImpl fold = null; + if (folderID == libraryRoot.ID) + { + return libraryRoot.RequestListOfItems(); + } - CachedUserInfo userProfile; - if (m_userProfiles.TryGetValue(agentID, out userProfile)) + if ((fold = libraryRoot.HasSubFolder(folderID)) != null) + { + return fold.RequestListOfItems(); + } + + CachedUserInfo userProfile; + if (m_userProfiles.TryGetValue(agentID, out userProfile)) + { + if (userProfile.RootFolder != null) { - if (userProfile.RootFolder != null) + if (userProfile.RootFolder.ID == folderID) { - if (userProfile.RootFolder.ID == folderID) - { - return userProfile.RootFolder.RequestListOfItems(); - } - else - { - if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) - { - return fold.RequestListOfItems(); - } - } + return userProfile.RootFolder.RequestListOfItems(); } else { - m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", agentID.ToString()); - - return new List(); ; + if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) + { + return fold.RequestListOfItems(); + } } } else { - m_log.ErrorFormat( - "[USER CACHE]: HandleFetchInventoryDescendentsCAPS() Could not find user profile for {0}", - agentID); - - return new List(); - } + m_log.ErrorFormat("[INVENTORY CACHE]: Could not find root folder for user {0}", agentID.ToString()); + + return new List(); ; + } + } + else + { + m_log.ErrorFormat( + "[USER CACHE]: HandleFetchInventoryDescendentsCAPS() Could not find user profile for {0}", + agentID); + + return new List(); + } + + // If we've reached this point then we couldn't find the folder, even though the client thinks + // it exists + m_log.ErrorFormat("[INVENTORY CACHE]: " + + "Could not find folder {0} for user {1}", + folderID, agentID.ToString()); - // If we've reached this point then we couldn't find the folder, even though the client thinks - // it exists - m_log.ErrorFormat("[INVENTORY CACHE]: " + - "Could not find folder {0} for user {1}", - folderID, agentID.ToString()); - // } return new List(); } @@ -400,6 +409,11 @@ namespace OpenSim.Framework.Communications.Cache } } + /// + /// Request the inventory data for the given user. + /// + /// + /// private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) { m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index e30c31e2d0..1ae52434e3 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs @@ -27,7 +27,10 @@ using System; using System.Collections.Generic; +using System.Threading; + using libsecondlife; + using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Console; @@ -103,6 +106,9 @@ namespace OpenSim.Grid.InventoryServer /// The user's inventory. If an inventory cannot be found then an empty collection is returned. public InventoryCollection GetUserInventory(Guid rawUserID) { + // uncomment me to simulate an overloaded inventory server + //Thread.Sleep(40000); + LLUUID userID = new LLUUID(rawUserID); m_log.InfoFormat("[AGENT INVENTORY]: Processing request for inventory of {0}", userID);