diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 9179dc73f7..e13ee42976 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -62,6 +62,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private InventoryCache m_Cache = new InventoryCache();
+ ///
+ /// Used to serialize inventory requests.
+ ///
+ private object m_Lock = new object();
+
protected IUserManagement m_UserManagement;
protected IUserManagement UserManagementModule
{
@@ -301,7 +306,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public bool CreateUserInventory(UUID userID)
{
- return m_LocalGridInventoryService.CreateUserInventory(userID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.CreateUserInventory(userID);
}
public List GetInventorySkeleton(UUID userID)
@@ -309,7 +315,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetInventorySkeleton(userID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetInventorySkeleton(userID);
IInventoryService connector = GetConnector(invURL);
@@ -326,7 +333,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetRootFolder(userID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetRootFolder(userID);
IInventoryService connector = GetConnector(invURL);
@@ -347,7 +355,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolderForType(userID, type);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolderForType(userID, type);
IInventoryService connector = GetConnector(invURL);
@@ -365,7 +374,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolderContent(userID, folderID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolderContent(userID, folderID);
InventoryCollection c = m_Cache.GetFolderContent(userID, folderID);
if (c != null)
@@ -375,8 +385,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
}
IInventoryService connector = GetConnector(invURL);
- return connector.GetFolderContent(userID, folderID);
+ return connector.GetFolderContent(userID, folderID);
}
public List GetFolderItems(UUID userID, UUID folderID)
@@ -386,7 +396,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolderItems(userID, folderID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolderItems(userID, folderID);
List items = m_Cache.GetFolderItems(userID, folderID);
if (items != null)
@@ -396,8 +407,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
}
IInventoryService connector = GetConnector(invURL);
- return connector.GetFolderItems(userID, folderID);
+ return connector.GetFolderItems(userID, folderID);
}
public bool AddFolder(InventoryFolderBase folder)
@@ -410,7 +421,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.AddFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.AddFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -427,7 +439,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.UpdateFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.UpdateFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -446,7 +459,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs);
IInventoryService connector = GetConnector(invURL);
@@ -463,7 +477,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.MoveFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.MoveFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -480,7 +495,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.PurgeFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.PurgeFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -497,7 +513,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(item.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.AddItem(item);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.AddItem(item);
IInventoryService connector = GetConnector(invURL);
@@ -514,7 +531,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(item.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.UpdateItem(item);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.UpdateItem(item);
IInventoryService connector = GetConnector(invURL);
@@ -533,7 +551,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.MoveItems(ownerID, items);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.MoveItems(ownerID, items);
IInventoryService connector = GetConnector(invURL);
@@ -552,7 +571,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(ownerID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs);
IInventoryService connector = GetConnector(invURL);
@@ -568,7 +588,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(item.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetItem(item);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetItem(item);
IInventoryService connector = GetConnector(invURL);
@@ -585,7 +606,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(folder.Owner);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetFolder(folder);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetFolder(folder);
IInventoryService connector = GetConnector(invURL);
@@ -609,7 +631,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string invURL = GetInventoryServiceURL(userID);
if (invURL == null) // not there, forward to local inventory connector to resolve
- return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID);
+ lock (m_Lock)
+ return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID);
IInventoryService connector = GetConnector(invURL);
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index 93f9d48041..574de892ce 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
@@ -62,8 +62,6 @@ namespace OpenSim.Services.Connectors
///
private int m_requestTimeoutSecs = -1;
- private object m_Lock = new object();
-
public XInventoryServicesConnector()
{
}
@@ -533,11 +531,10 @@ namespace OpenSim.Services.Connectors
RequestsMade++;
- string reply = string.Empty;
- lock (m_Lock)
- reply = SynchronousRestFormsRequester.MakeRequest("POST",
- m_ServerURI + "/xinventory",
- ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth);
+ string reply
+ = SynchronousRestFormsRequester.MakeRequest(
+ "POST", m_ServerURI + "/xinventory",
+ ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth);
Dictionary replyData = ServerUtils.ParseXmlResponse(
reply);