diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 10 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs | 9 |
2 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 9d6d9ad..88a3026 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -52,6 +52,8 @@ namespace OpenSim.Services.Connectors | |||
52 | private int m_retryCounter; | 52 | private int m_retryCounter; |
53 | private Dictionary<int, List<AssetBase>> m_retryQueue = new Dictionary<int, List<AssetBase>>(); | 53 | private Dictionary<int, List<AssetBase>> m_retryQueue = new Dictionary<int, List<AssetBase>>(); |
54 | private System.Timers.Timer m_retryTimer; | 54 | private System.Timers.Timer m_retryTimer; |
55 | private int m_maxAssetRequestConcurrency = 30; | ||
56 | |||
55 | private delegate void AssetRetrievedEx(AssetBase asset); | 57 | private delegate void AssetRetrievedEx(AssetBase asset); |
56 | 58 | ||
57 | // Keeps track of concurrent requests for the same asset, so that it's only loaded once. | 59 | // Keeps track of concurrent requests for the same asset, so that it's only loaded once. |
@@ -80,6 +82,10 @@ namespace OpenSim.Services.Connectors | |||
80 | 82 | ||
81 | public virtual void Initialise(IConfigSource source) | 83 | public virtual void Initialise(IConfigSource source) |
82 | { | 84 | { |
85 | IConfig netconfig = source.Configs["Network"]; | ||
86 | if (netconfig != null) | ||
87 | m_maxAssetRequestConcurrency = netconfig.GetInt("MaxRequestConcurrency",m_maxAssetRequestConcurrency); | ||
88 | |||
83 | IConfig assetConfig = source.Configs["AssetService"]; | 89 | IConfig assetConfig = source.Configs["AssetService"]; |
84 | if (assetConfig == null) | 90 | if (assetConfig == null) |
85 | { | 91 | { |
@@ -204,7 +210,7 @@ namespace OpenSim.Services.Connectors | |||
204 | if (asset == null || asset.Data == null || asset.Data.Length == 0) | 210 | if (asset == null || asset.Data == null || asset.Data.Length == 0) |
205 | { | 211 | { |
206 | asset = SynchronousRestObjectRequester. | 212 | asset = SynchronousRestObjectRequester. |
207 | MakeRequest<int, AssetBase>("GET", uri, 0, 30); | 213 | MakeRequest<int, AssetBase>("GET", uri, 0, m_maxAssetRequestConcurrency); |
208 | 214 | ||
209 | if (m_Cache != null) | 215 | if (m_Cache != null) |
210 | m_Cache.Cache(asset); | 216 | m_Cache.Cache(asset); |
@@ -311,7 +317,7 @@ namespace OpenSim.Services.Connectors | |||
311 | h.Invoke(a); | 317 | h.Invoke(a); |
312 | if (handlers != null) | 318 | if (handlers != null) |
313 | handlers.Clear(); | 319 | handlers.Clear(); |
314 | }, 30); | 320 | }, m_maxAssetRequestConcurrency); |
315 | 321 | ||
316 | success = true; | 322 | success = true; |
317 | } | 323 | } |
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs index 20d7eaf..94bda82 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs | |||
@@ -207,7 +207,7 @@ namespace OpenSim.Services.Connectors | |||
207 | if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null)) | 207 | if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null)) |
208 | { | 208 | { |
209 | if (replyData["result"] is Dictionary<string, object>) | 209 | if (replyData["result"] is Dictionary<string, object>) |
210 | guinfo = new GridUserInfo((Dictionary<string, object>)replyData["result"]); | 210 | guinfo = Create((Dictionary<string, object>)replyData["result"]); |
211 | } | 211 | } |
212 | 212 | ||
213 | return guinfo; | 213 | return guinfo; |
@@ -273,7 +273,7 @@ namespace OpenSim.Services.Connectors | |||
273 | { | 273 | { |
274 | if (griduser is Dictionary<string, object>) | 274 | if (griduser is Dictionary<string, object>) |
275 | { | 275 | { |
276 | GridUserInfo pinfo = new GridUserInfo((Dictionary<string, object>)griduser); | 276 | GridUserInfo pinfo = Create((Dictionary<string, object>)griduser); |
277 | rinfos.Add(pinfo); | 277 | rinfos.Add(pinfo); |
278 | } | 278 | } |
279 | else | 279 | else |
@@ -286,5 +286,10 @@ namespace OpenSim.Services.Connectors | |||
286 | 286 | ||
287 | return rinfos.ToArray(); | 287 | return rinfos.ToArray(); |
288 | } | 288 | } |
289 | |||
290 | protected virtual GridUserInfo Create(Dictionary<string, object> griduser) | ||
291 | { | ||
292 | return new GridUserInfo(griduser); | ||
293 | } | ||
289 | } | 294 | } |
290 | } | 295 | } |