diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | 18 |
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); |