diff options
author | Melanie Thielker | 2008-08-27 00:40:36 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-27 00:40:36 +0000 |
commit | 670719cb76cdf2b624ec84d631cc14f507e5840b (patch) | |
tree | 6ea56f3d55f50d1c83f376ef183b24c9d20098a1 | |
parent | * Eliminate commented out code no longer needed, as discussed on the ml (diff) | |
download | opensim-SC-670719cb76cdf2b624ec84d631cc14f507e5840b.zip opensim-SC-670719cb76cdf2b624ec84d631cc14f507e5840b.tar.gz opensim-SC-670719cb76cdf2b624ec84d631cc14f507e5840b.tar.bz2 opensim-SC-670719cb76cdf2b624ec84d631cc14f507e5840b.tar.xz |
Mantis #1903
Thank you, cmickeyb, for a patch that prevents the loss of folders received
out of sequence, and the items within.
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 31 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 8 |
2 files changed, 29 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index a7d6349..17f927d 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -150,6 +150,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | |||
153 | /// <summary> | 154 | /// <summary> |
154 | /// Add any pending folders which were received before the given folder | 155 | /// Add any pending folders which were received before the given folder |
155 | /// </summary> | 156 | /// </summary> |
@@ -160,20 +161,24 @@ namespace OpenSim.Framework.Communications.Cache | |||
160 | { | 161 | { |
161 | if (pendingCategorizationFolders.ContainsKey(newFolder.ID)) | 162 | if (pendingCategorizationFolders.ContainsKey(newFolder.ID)) |
162 | { | 163 | { |
164 | List<InventoryFolderImpl> resolvedFolders = new List<InventoryFolderImpl>(); // Folders we've resolved with this invocation | ||
163 | foreach (InventoryFolderImpl folder in pendingCategorizationFolders[newFolder.ID]) | 165 | foreach (InventoryFolderImpl folder in pendingCategorizationFolders[newFolder.ID]) |
164 | { | 166 | { |
165 | // m_log.DebugFormat( | 167 | // m_log.DebugFormat( |
166 | // "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}", | 168 | // "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}", |
167 | // folder.name, folder.folderID, parent.name, parent.folderID); | 169 | // folder.name, folder.folderID, parent.name, parent.folderID); |
168 | |||
169 | lock (newFolder.SubFolders) | 170 | lock (newFolder.SubFolders) |
170 | { | 171 | { |
171 | if (!newFolder.SubFolders.ContainsKey(folder.ID)) | 172 | if (!newFolder.SubFolders.ContainsKey(folder.ID)) |
172 | { | 173 | { |
174 | resolvedFolders.Add(folder); | ||
173 | newFolder.SubFolders.Add(folder.ID, folder); | 175 | newFolder.SubFolders.Add(folder.ID, folder); |
174 | } | 176 | } |
175 | } | 177 | } |
176 | } | 178 | } |
179 | pendingCategorizationFolders.Remove(newFolder.ID); | ||
180 | foreach (InventoryFolderImpl folder in resolvedFolders) | ||
181 | ResolvePendingFolders(folder); | ||
177 | } | 182 | } |
178 | } | 183 | } |
179 | 184 | ||
@@ -201,13 +206,19 @@ namespace OpenSim.Framework.Communications.Cache | |||
201 | { | 206 | { |
202 | // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these | 207 | // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these |
203 | // are simply being swallowed | 208 | // are simply being swallowed |
209 | |||
204 | try | 210 | try |
205 | { | 211 | { |
206 | foreach (InventoryFolderImpl folder in folders) | 212 | foreach (InventoryFolderImpl folder in folders) |
207 | { | 213 | { |
208 | FolderReceive(folder); | 214 | FolderReceive(folder); |
209 | } | 215 | } |
210 | 216 | // Generate a warning for folders that are not part of the heirarchy | |
217 | foreach ( KeyValuePair<LLUUID, IList<InventoryFolderImpl>> folderList in pendingCategorizationFolders) | ||
218 | { | ||
219 | foreach (InventoryFolderImpl folder in folderList.Value) | ||
220 | m_log.WarnFormat("[INVENTORY CACHE]: Malformed Database: Unresolved Pending Folder {0}", folder.Name); | ||
221 | } | ||
211 | foreach (InventoryItemBase item in items) | 222 | foreach (InventoryItemBase item in items) |
212 | { | 223 | { |
213 | ItemReceive(item); | 224 | ItemReceive(item); |
@@ -258,7 +269,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
258 | { | 269 | { |
259 | InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID); | 270 | InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID); |
260 | 271 | ||
261 | if (parentFolder != null) | 272 | if (parentFolder == null) |
273 | { | ||
274 | AddPendingFolder(newFolder); | ||
275 | } | ||
276 | else | ||
262 | { | 277 | { |
263 | lock (parentFolder.SubFolders) | 278 | lock (parentFolder.SubFolders) |
264 | { | 279 | { |
@@ -274,12 +289,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
274 | } | 289 | } |
275 | } | 290 | } |
276 | } | 291 | } |
277 | else | ||
278 | { | ||
279 | AddPendingFolder(newFolder); | ||
280 | } | ||
281 | } | 292 | } |
282 | |||
283 | ResolvePendingFolders(newFolder); | 293 | ResolvePendingFolders(newFolder); |
284 | } | 294 | } |
285 | 295 | ||
@@ -295,7 +305,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
295 | // m_log.DebugFormat( | 305 | // m_log.DebugFormat( |
296 | // "[INVENTORY CACHE]: Received item {0} {1} for user {2}", | 306 | // "[INVENTORY CACHE]: Received item {0} {1} for user {2}", |
297 | // itemInfo.Name, itemInfo.ID, userID); | 307 | // itemInfo.Name, itemInfo.ID, userID); |
298 | InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder); | 308 | InventoryFolderImpl folder = null; |
309 | |||
310 | if ( RootFolder != null ) | ||
311 | folder = RootFolder.FindFolder(itemInfo.Folder); | ||
299 | 312 | ||
300 | if (null == folder) | 313 | if (null == folder) |
301 | { | 314 | { |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 3b02c88..017cb29 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -440,7 +440,13 @@ namespace OpenSim.Framework.Communications.Cache | |||
440 | { | 440 | { |
441 | if (userProfile.HasReceivedInventory) | 441 | if (userProfile.HasReceivedInventory) |
442 | { | 442 | { |
443 | InventoryItemBase item = userProfile.RootFolder.FindItem(itemID); | 443 | InventoryItemBase item = null; |
444 | if ( userProfile.RootFolder == null ) | ||
445 | m_log.ErrorFormat( | ||
446 | "[AGENT INVENTORY]: User {0} {1} does not have a root folder.", | ||
447 | remoteClient.Name, remoteClient.AgentId); | ||
448 | else | ||
449 | item = userProfile.RootFolder.FindItem(itemID); | ||
444 | if (item != null) | 450 | if (item != null) |
445 | { | 451 | { |
446 | remoteClient.SendInventoryItemDetails(ownerID, item); | 452 | remoteClient.SendInventoryItemDetails(ownerID, item); |