diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
3 files changed, 26 insertions, 8 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index a6e8eb4..bdc3bef 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Services.Connectors | |||
49 | const int MAXSENDRETRIESLEN = 30; | 49 | const int MAXSENDRETRIESLEN = 30; |
50 | 50 | ||
51 | private string m_ServerURI = String.Empty; | 51 | private string m_ServerURI = String.Empty; |
52 | private IImprovedAssetCache m_Cache = null; | 52 | private IAssetCache m_Cache = null; |
53 | private int m_retryCounter; | 53 | private int m_retryCounter; |
54 | private bool m_inRetries; | 54 | private bool m_inRetries; |
55 | private List<AssetBase>[] m_sendRetries = new List<AssetBase>[MAXSENDRETRIESLEN]; | 55 | private List<AssetBase>[] m_sendRetries = new List<AssetBase>[MAXSENDRETRIESLEN]; |
@@ -233,7 +233,7 @@ namespace OpenSim.Services.Connectors | |||
233 | } | 233 | } |
234 | } | 234 | } |
235 | 235 | ||
236 | protected void SetCache(IImprovedAssetCache cache) | 236 | protected void SetCache(IAssetCache cache) |
237 | { | 237 | { |
238 | m_Cache = cache; | 238 | m_Cache = cache; |
239 | } | 239 | } |
@@ -260,8 +260,13 @@ namespace OpenSim.Services.Connectors | |||
260 | asset = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, m_Auth); | 260 | asset = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, m_Auth); |
261 | 261 | ||
262 | 262 | ||
263 | if (asset != null && m_Cache != null) | 263 | if (m_Cache != null) |
264 | m_Cache.Cache(asset); | 264 | { |
265 | if (asset != null) | ||
266 | m_Cache.Cache(asset); | ||
267 | else | ||
268 | m_Cache.CacheNegative(id); | ||
269 | } | ||
265 | } | 270 | } |
266 | return asset; | 271 | return asset; |
267 | } | 272 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index d80e660..2ddd7a2 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | |||
@@ -54,6 +54,8 @@ namespace OpenSim.Services.Connectors | |||
54 | 54 | ||
55 | private string m_ServerURI = String.Empty; | 55 | private string m_ServerURI = String.Empty; |
56 | 56 | ||
57 | private int m_maxRetries = 0; | ||
58 | |||
57 | /// <summary> | 59 | /// <summary> |
58 | /// Timeout for remote requests. | 60 | /// Timeout for remote requests. |
59 | /// </summary> | 61 | /// </summary> |
@@ -100,6 +102,7 @@ namespace OpenSim.Services.Connectors | |||
100 | m_ServerURI = serviceURI; | 102 | m_ServerURI = serviceURI; |
101 | 103 | ||
102 | m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); | 104 | m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); |
105 | m_maxRetries = config.GetInt("MaxRetries", m_maxRetries); | ||
103 | 106 | ||
104 | StatsManager.RegisterStat( | 107 | StatsManager.RegisterStat( |
105 | new Stat( | 108 | new Stat( |
@@ -700,10 +703,20 @@ namespace OpenSim.Services.Connectors | |||
700 | 703 | ||
701 | RequestsMade++; | 704 | RequestsMade++; |
702 | 705 | ||
703 | string reply | 706 | string reply = String.Empty; |
704 | = SynchronousRestFormsRequester.MakeRequest( | 707 | int retries = 0; |
708 | |||
709 | do | ||
710 | { | ||
711 | reply = SynchronousRestFormsRequester.MakeRequest( | ||
705 | "POST", m_ServerURI + "/xinventory", | 712 | "POST", m_ServerURI + "/xinventory", |
706 | ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth); | 713 | ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth); |
714 | |||
715 | if (reply != String.Empty) | ||
716 | break; | ||
717 | |||
718 | retries++; | ||
719 | } while (retries <= m_maxRetries); | ||
707 | 720 | ||
708 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( | 721 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( |
709 | reply); | 722 | reply); |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 9ad4a7a..531939f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
55 | private static string ZeroID = UUID.Zero.ToString(); | 55 | private static string ZeroID = UUID.Zero.ToString(); |
56 | 56 | ||
57 | private string m_serverUrl = String.Empty; | 57 | private string m_serverUrl = String.Empty; |
58 | private IImprovedAssetCache m_cache; | 58 | private IAssetCache m_cache; |
59 | private bool m_Enabled = false; | 59 | private bool m_Enabled = false; |
60 | 60 | ||
61 | #region ISharedRegionModule | 61 | #region ISharedRegionModule |
@@ -65,7 +65,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
65 | { | 65 | { |
66 | if (m_cache == null) | 66 | if (m_cache == null) |
67 | { | 67 | { |
68 | IImprovedAssetCache cache = scene.RequestModuleInterface<IImprovedAssetCache>(); | 68 | IAssetCache cache = scene.RequestModuleInterface<IAssetCache>(); |
69 | if (cache is ISharedRegionModule) | 69 | if (cache is ISharedRegionModule) |
70 | m_cache = cache; | 70 | m_cache = cache; |
71 | } | 71 | } |