From c0c92a95bfc5359661958d4587741b481f1b605f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jul 2014 23:06:23 +0100
Subject: Add undocumented RemoteRequestTimeout seconds parameter to xinventory
requests
This is for testing purposes (chiefly http://opensimulator.org/mantis/view.php?id=7054) so many not be permanent
Setting this will change the xinventory request timeout from the simulator from the default 100 seconds
---
.../Inventory/XInventoryServicesConnector.cs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index f86d2f1..b914737 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
@@ -48,6 +48,14 @@ namespace OpenSim.Services.Connectors
private string m_ServerURI = String.Empty;
+ ///
+ /// Timeout for remote requests.
+ ///
+ ///
+ /// In this case, -1 is default timeout (100 seconds), not infinite.
+ ///
+ private int m_requestTimeoutSecs = -1;
+
private object m_Lock = new object();
public XInventoryServicesConnector()
@@ -67,14 +75,14 @@ namespace OpenSim.Services.Connectors
public virtual void Initialise(IConfigSource source)
{
- IConfig assetConfig = source.Configs["InventoryService"];
- if (assetConfig == null)
+ IConfig config = source.Configs["InventoryService"];
+ if (config == null)
{
m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
throw new Exception("Inventory connector init error");
}
- string serviceURI = assetConfig.GetString("InventoryServerURI",
+ string serviceURI = config.GetString("InventoryServerURI",
String.Empty);
if (serviceURI == String.Empty)
@@ -83,6 +91,8 @@ namespace OpenSim.Services.Connectors
throw new Exception("Inventory connector init error");
}
m_ServerURI = serviceURI;
+
+ m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs);
}
private bool CheckReturn(Dictionary ret)
@@ -506,7 +516,7 @@ namespace OpenSim.Services.Connectors
lock (m_Lock)
reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/xinventory",
- ServerUtils.BuildQueryString(sendData), m_Auth);
+ ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth);
Dictionary replyData = ServerUtils.ParseXmlResponse(
reply);
--
cgit v1.1