aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-15 18:36:22 +0100
committerJustin Clark-Casey (justincc)2011-09-15 18:36:22 +0100
commit8fb3e71b14e28bf8a4ddb72e3d1b529128f090ce (patch)
treefd15f12b017722fdf496cdb909ab9c1933a1f538
parentIf a prim inventory becomes empty through deletion, send an empty xfer file n... (diff)
downloadopensim-SC_OLD-8fb3e71b14e28bf8a4ddb72e3d1b529128f090ce.zip
opensim-SC_OLD-8fb3e71b14e28bf8a4ddb72e3d1b529128f090ce.tar.gz
opensim-SC_OLD-8fb3e71b14e28bf8a4ddb72e3d1b529128f090ce.tar.bz2
opensim-SC_OLD-8fb3e71b14e28bf8a4ddb72e3d1b529128f090ce.tar.xz
Shuffle order of code in invnetory connector GetFolderContent() calls to avoid a possible race condition
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs15
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs2
3 files changed, 19 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 1c83f8e..097ff1a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -185,15 +185,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
185 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 185 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
186 { 186 {
187 InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); 187 InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID);
188 Util.FireAndForget(delegate 188
189 if (UserManager != null)
189 { 190 {
190 if (UserManager != null) 191 // Protect ourselves against the caller subsequently modifying the items list
192 List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items);
193
194 Util.FireAndForget(delegate
191 { 195 {
192 // Protect ourselves against the caller subsequently modifying the items list 196 foreach (InventoryItemBase item in items)
193 foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items))
194 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); 197 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
195 } 198 });
196 }); 199 }
197 200
198 return invCol; 201 return invCol;
199 } 202 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index c9c716c..73ab4e3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -193,15 +193,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
193 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 193 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
194 { 194 {
195 InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); 195 InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID);
196 Util.FireAndForget(delegate 196
197 if (UserManager != null)
197 { 198 {
198 if (UserManager != null) 199 // Protect ourselves against the caller subsequently modifying the items list
200 List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items);
201
202 Util.FireAndForget(delegate
199 { 203 {
200 // Protect ourselves against the caller subsequently modifying the items list 204 foreach (InventoryItemBase item in items)
201 foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items))
202 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); 205 UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
203 } 206 });
204 }); 207 }
205 208
206 return invCol; 209 return invCol;
207 } 210 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 59ac30d..6085f1e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -875,7 +875,7 @@ namespace OpenSim.Region.Framework.Scenes
875// m_log.DebugFormat( 875// m_log.DebugFormat(
876// "[PRIM INVENTORY]: Not sending inventory data for part {0} {1} {2} for {3} since no items", 876// "[PRIM INVENTORY]: Not sending inventory data for part {0} {1} {2} for {3} since no items",
877// m_part.Name, m_part.LocalId, m_part.UUID, client.Name); 877// m_part.Name, m_part.LocalId, m_part.UUID, client.Name);
878 878
879 client.SendTaskInventory(m_part.UUID, 0, new byte[0]); 879 client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
880 return; 880 return;
881 } 881 }