diff options
author | Dr Scofield | 2009-05-22 15:18:41 +0000 |
---|---|---|
committer | Dr Scofield | 2009-05-22 15:18:41 +0000 |
commit | 55442f3644a10a84e56f2b9ffe0f83e9f89bd7f4 (patch) | |
tree | 2230d05e6b6604d87edc603100192a7f8c1a9183 | |
parent | cleaning out warnings. (diff) | |
download | opensim-SC-55442f3644a10a84e56f2b9ffe0f83e9f89bd7f4.zip opensim-SC-55442f3644a10a84e56f2b9ffe0f83e9f89bd7f4.tar.gz opensim-SC-55442f3644a10a84e56f2b9ffe0f83e9f89bd7f4.tar.bz2 opensim-SC-55442f3644a10a84e56f2b9ffe0f83e9f89bd7f4.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalInventoryService.cs | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index d4560be..4ff4e96 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs | |||
@@ -48,43 +48,49 @@ namespace OpenSim.Region.Communications.Local | |||
48 | { | 48 | { |
49 | m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); | 49 | m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); |
50 | 50 | ||
51 | List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID); | ||
52 | if (skeletonFolders == null) | ||
53 | return; | ||
54 | |||
55 | InventoryFolderImpl rootFolder = null; | ||
56 | |||
57 | List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); | 51 | List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); |
58 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 52 | List<InventoryItemBase> items = new List<InventoryItemBase>(); |
59 | 53 | ||
60 | // Need to retrieve the root folder on the first pass | 54 | List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID); |
61 | foreach (InventoryFolderBase folder in skeletonFolders) | 55 | |
56 | if (skeletonFolders != null) | ||
62 | { | 57 | { |
63 | if (folder.ParentID == UUID.Zero) | 58 | |
64 | { | 59 | InventoryFolderImpl rootFolder = null; |
65 | rootFolder = new InventoryFolderImpl(folder); | ||
66 | folders.Add(rootFolder); | ||
67 | items.AddRange(RequestFolderItems(rootFolder.ID)); | ||
68 | break; // Only 1 root folder per user | ||
69 | } | ||
70 | } | ||
71 | 60 | ||
72 | if (rootFolder != null) | 61 | // Need to retrieve the root folder on the first pass |
62 | foreach (InventoryFolderBase folder in skeletonFolders) | ||
63 | { | ||
64 | if (folder.ParentID == UUID.Zero) | ||
65 | { | ||
66 | rootFolder = new InventoryFolderImpl(folder); | ||
67 | folders.Add(rootFolder); | ||
68 | items.AddRange(RequestFolderItems(rootFolder.ID)); | ||
69 | break; // Only 1 root folder per user | ||
70 | } | ||
71 | } | ||
72 | |||
73 | if (rootFolder != null) | ||
74 | { | ||
75 | foreach (InventoryFolderBase folder in skeletonFolders) | ||
76 | { | ||
77 | if (folder.ID != rootFolder.ID) | ||
78 | { | ||
79 | folders.Add(new InventoryFolderImpl(folder)); | ||
80 | items.AddRange(RequestFolderItems(folder.ID)); | ||
81 | } | ||
82 | } | ||
83 | } | ||
84 | |||
85 | m_log.InfoFormat( | ||
86 | "[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", | ||
87 | userID, folders.Count, items.Count); | ||
88 | } | ||
89 | else | ||
73 | { | 90 | { |
74 | foreach (InventoryFolderBase folder in skeletonFolders) | 91 | m_log.WarnFormat( "[LOCAL INVENTORY SERVICE]: User {0} inventory not available", userID); |
75 | { | ||
76 | if (folder.ID != rootFolder.ID) | ||
77 | { | ||
78 | folders.Add(new InventoryFolderImpl(folder)); | ||
79 | items.AddRange(RequestFolderItems(folder.ID)); | ||
80 | } | ||
81 | } | ||
82 | } | 92 | } |
83 | 93 | ||
84 | m_log.InfoFormat( | ||
85 | "[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", | ||
86 | userID, folders.Count, items.Count); | ||
87 | |||
88 | callback(folders, items); | 94 | callback(folders, items); |
89 | } | 95 | } |
90 | 96 | ||