aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-25 23:06:23 +0100
committerJustin Clark-Casey (justincc)2014-07-25 23:06:23 +0100
commitc0c92a95bfc5359661958d4587741b481f1b605f (patch)
tree1bc957b2d2ea8f2d26a86b55373e8644e9d98138
parentAdd stats for service endpoints using existing data. (diff)
downloadopensim-SC-c0c92a95bfc5359661958d4587741b481f1b605f.zip
opensim-SC-c0c92a95bfc5359661958d4587741b481f1b605f.tar.gz
opensim-SC-c0c92a95bfc5359661958d4587741b481f1b605f.tar.bz2
opensim-SC-c0c92a95bfc5359661958d4587741b481f1b605f.tar.xz
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
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs18
1 files 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
48 48
49 private string m_ServerURI = String.Empty; 49 private string m_ServerURI = String.Empty;
50 50
51 /// <summary>
52 /// Timeout for remote requests.
53 /// </summary>
54 /// <remarks>
55 /// In this case, -1 is default timeout (100 seconds), not infinite.
56 /// </remarks>
57 private int m_requestTimeoutSecs = -1;
58
51 private object m_Lock = new object(); 59 private object m_Lock = new object();
52 60
53 public XInventoryServicesConnector() 61 public XInventoryServicesConnector()
@@ -67,14 +75,14 @@ namespace OpenSim.Services.Connectors
67 75
68 public virtual void Initialise(IConfigSource source) 76 public virtual void Initialise(IConfigSource source)
69 { 77 {
70 IConfig assetConfig = source.Configs["InventoryService"]; 78 IConfig config = source.Configs["InventoryService"];
71 if (assetConfig == null) 79 if (config == null)
72 { 80 {
73 m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); 81 m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
74 throw new Exception("Inventory connector init error"); 82 throw new Exception("Inventory connector init error");
75 } 83 }
76 84
77 string serviceURI = assetConfig.GetString("InventoryServerURI", 85 string serviceURI = config.GetString("InventoryServerURI",
78 String.Empty); 86 String.Empty);
79 87
80 if (serviceURI == String.Empty) 88 if (serviceURI == String.Empty)
@@ -83,6 +91,8 @@ namespace OpenSim.Services.Connectors
83 throw new Exception("Inventory connector init error"); 91 throw new Exception("Inventory connector init error");
84 } 92 }
85 m_ServerURI = serviceURI; 93 m_ServerURI = serviceURI;
94
95 m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs);
86 } 96 }
87 97
88 private bool CheckReturn(Dictionary<string, object> ret) 98 private bool CheckReturn(Dictionary<string, object> ret)
@@ -506,7 +516,7 @@ namespace OpenSim.Services.Connectors
506 lock (m_Lock) 516 lock (m_Lock)
507 reply = SynchronousRestFormsRequester.MakeRequest("POST", 517 reply = SynchronousRestFormsRequester.MakeRequest("POST",
508 m_ServerURI + "/xinventory", 518 m_ServerURI + "/xinventory",
509 ServerUtils.BuildQueryString(sendData), m_Auth); 519 ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth);
510 520
511 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( 521 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
512 reply); 522 reply);