aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-04 01:04:49 +0000
committerJustin Clarke Casey2008-05-04 01:04:49 +0000
commit6c62985fd524cf502f8468b4aa303e558aff3b1c (patch)
tree588a36f8ee898b1bad149292001c85f64dd41c96
parent* Refactor: Simplify CachedUserInfo.FolderReceive() by removing root folder s... (diff)
downloadopensim-SC_OLD-6c62985fd524cf502f8468b4aa303e558aff3b1c.zip
opensim-SC_OLD-6c62985fd524cf502f8468b4aa303e558aff3b1c.tar.gz
opensim-SC_OLD-6c62985fd524cf502f8468b4aa303e558aff3b1c.tar.bz2
opensim-SC_OLD-6c62985fd524cf502f8468b4aa303e558aff3b1c.tar.xz
* Refactor: Do the root case removal thing again, this time in ItemReceive()
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs47
1 files changed, 13 insertions, 34 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 18bd994..03ba1db 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -258,7 +258,7 @@ namespace OpenSim.Framework.Communications.Cache
258 /// <summary> 258 /// <summary>
259 /// Callback invoked when an item is received from an async request to the inventory service. 259 /// Callback invoked when an item is received from an async request to the inventory service.
260 /// 260 ///
261 /// We're assuming here that items are always received after all the folders have been 261 /// We're assuming here that items are always received after all the folders
262 /// received. 262 /// received.
263 /// </summary> 263 /// </summary>
264 /// <param name="folderInfo"></param> 264 /// <param name="folderInfo"></param>
@@ -267,41 +267,20 @@ namespace OpenSim.Framework.Communications.Cache
267// m_log.DebugFormat( 267// m_log.DebugFormat(
268// "[INVENTORY CACHE]: Received item {0} {1} for user {2}", 268// "[INVENTORY CACHE]: Received item {0} {1} for user {2}",
269// itemInfo.Name, itemInfo.ID, userID); 269// itemInfo.Name, itemInfo.ID, userID);
270 InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder);
270 271
271 if (RootFolder != null) 272 if (null == folder)
272 { 273 {
273 if (itemInfo.Folder == RootFolder.ID) 274 m_log.WarnFormat(
274 { 275 "Received item {0} {1} but its folder {2} does not exist",
275 lock (RootFolder.Items) 276 itemInfo.Name, itemInfo.ID, itemInfo.Folder);
276 { 277
277 if (!RootFolder.Items.ContainsKey(itemInfo.ID)) 278 return;
278 { 279 }
279 RootFolder.Items.Add(itemInfo.ID, itemInfo); 280
280 } 281 lock (folder.Items)
281 else 282 {
282 { 283 folder.Items[itemInfo.ID] = itemInfo;
283 RootFolder.Items[itemInfo.ID] = itemInfo;
284 }
285 }
286 }
287 else
288 {
289 InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder);
290 if (folder != null)
291 {
292 lock (folder.Items)
293 {
294 if (!folder.Items.ContainsKey(itemInfo.ID))
295 {
296 folder.Items.Add(itemInfo.ID, itemInfo);
297 }
298 else
299 {
300 folder.Items[itemInfo.ID] = itemInfo;
301 }
302 }
303 }
304 }
305 } 284 }
306 } 285 }
307 286