aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CachedUserInfo.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs31
1 files changed, 22 insertions, 9 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 {