From 18c5dc0953a1c142fd8c13658f6183d5b3c3482a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 Aug 2009 17:19:45 +0100
Subject: Try to cache system folders if they aren't already there when one is
requested This operation can be performed legitimately on standalones without
a logged in user
---
.../ServiceConnectorsOut/Inventory/InventoryCache.cs | 13 +++++++++++++
1 file changed, 13 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
index 73ffc5e..3c3534f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs
@@ -145,6 +145,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
m_InventoryCache.Remove(userID);
}
+ ///
+ /// Get the system folder for a particular asset type
+ ///
+ ///
+ ///
+ ///
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
{
Dictionary folders = null;
@@ -152,6 +158,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
lock (m_InventoryCache)
{
m_InventoryCache.TryGetValue(userID, out folders);
+
+ // In some situations (such as non-secured standalones), system folders can be requested without
+ // the user being logged in. So we need to try caching them here if we don't already have them.
+ if (null == folders)
+ CacheSystemFolders(userID);
+
+ m_InventoryCache.TryGetValue(userID, out folders);
}
if ((folders != null) && folders.ContainsKey(type))
--
cgit v1.1