aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-08-28 17:19:45 +0100
committerJustin Clark-Casey (justincc)2009-08-28 17:19:45 +0100
commit18c5dc0953a1c142fd8c13658f6183d5b3c3482a (patch)
treeb1843b5a4b58eacd7c92413c33993e3d002975b5 /OpenSim
parentPull out distinct cache system folders and drop cache methods in InventoryCache (diff)
downloadopensim-SC-18c5dc0953a1c142fd8c13658f6183d5b3c3482a.zip
opensim-SC-18c5dc0953a1c142fd8c13658f6183d5b3c3482a.tar.gz
opensim-SC-18c5dc0953a1c142fd8c13658f6183d5b3c3482a.tar.bz2
opensim-SC-18c5dc0953a1c142fd8c13658f6183d5b3c3482a.tar.xz
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
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs13
1 files changed, 13 insertions, 0 deletions
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
145 m_InventoryCache.Remove(userID); 145 m_InventoryCache.Remove(userID);
146 } 146 }
147 147
148 /// <summary>
149 /// Get the system folder for a particular asset type
150 /// </summary>
151 /// <param name="userID"></param>
152 /// <param name="type"></param>
153 /// <returns></returns>
148 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) 154 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
149 { 155 {
150 Dictionary<AssetType, InventoryFolderBase> folders = null; 156 Dictionary<AssetType, InventoryFolderBase> folders = null;
@@ -152,6 +158,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
152 lock (m_InventoryCache) 158 lock (m_InventoryCache)
153 { 159 {
154 m_InventoryCache.TryGetValue(userID, out folders); 160 m_InventoryCache.TryGetValue(userID, out folders);
161
162 // In some situations (such as non-secured standalones), system folders can be requested without
163 // the user being logged in. So we need to try caching them here if we don't already have them.
164 if (null == folders)
165 CacheSystemFolders(userID);
166
167 m_InventoryCache.TryGetValue(userID, out folders);
155 } 168 }
156 169
157 if ((folders != null) && folders.ContainsKey(type)) 170 if ((folders != null) && folders.ContainsKey(type))