From: Alan Webb <alan_webb@us.ibm.com>

RequestUserInventory is supposed to drive a supplied callback
  when it completes. In fact, it fails to do so if the user's
  inventory does not exist (e.g. the inventory database is
  unavailable for some reason), and the requestor is left
  sleeping forever.
  The code has been modified to return empty lists via the
  callback as an accurate reflection of what is there: nothing.
0.6.6-post-fixes
Dr Scofield 2009-05-22 15:18:41 +00:00
parent 1d02636c27
commit 55442f3644
1 changed files with 36 additions and 30 deletions

View File

@ -48,42 +48,48 @@ namespace OpenSim.Region.Communications.Local
{ {
m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID);
List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID);
if (skeletonFolders == null)
return;
InventoryFolderImpl rootFolder = null;
List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
List<InventoryItemBase> items = new List<InventoryItemBase>(); List<InventoryItemBase> items = new List<InventoryItemBase>();
// Need to retrieve the root folder on the first pass List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID);
foreach (InventoryFolderBase folder in skeletonFolders)
{
if (folder.ParentID == UUID.Zero)
{
rootFolder = new InventoryFolderImpl(folder);
folders.Add(rootFolder);
items.AddRange(RequestFolderItems(rootFolder.ID));
break; // Only 1 root folder per user
}
}
if (rootFolder != null) if (skeletonFolders != null)
{ {
foreach (InventoryFolderBase folder in skeletonFolders)
{ InventoryFolderImpl rootFolder = null;
if (folder.ID != rootFolder.ID)
{
folders.Add(new InventoryFolderImpl(folder));
items.AddRange(RequestFolderItems(folder.ID));
}
}
}
m_log.InfoFormat( // Need to retrieve the root folder on the first pass
"[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", foreach (InventoryFolderBase folder in skeletonFolders)
userID, folders.Count, items.Count); {
if (folder.ParentID == UUID.Zero)
{
rootFolder = new InventoryFolderImpl(folder);
folders.Add(rootFolder);
items.AddRange(RequestFolderItems(rootFolder.ID));
break; // Only 1 root folder per user
}
}
if (rootFolder != null)
{
foreach (InventoryFolderBase folder in skeletonFolders)
{
if (folder.ID != rootFolder.ID)
{
folders.Add(new InventoryFolderImpl(folder));
items.AddRange(RequestFolderItems(folder.ID));
}
}
}
m_log.InfoFormat(
"[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items",
userID, folders.Count, items.Count);
}
else
{
m_log.WarnFormat( "[LOCAL INVENTORY SERVICE]: User {0} inventory not available", userID);
}
callback(folders, items); callback(folders, items);
} }