From 19c5f9ce1d42d27c92de8ccd6c3ba679601ec258 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 15 Sep 2015 21:33:26 +0100 Subject: fix bad side efects of missing avination optional configuration --- .../Connectors/Asset/AssetServicesConnector.cs | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 8529f92..ea506c8 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -139,6 +139,9 @@ namespace OpenSim.Services.Connectors private string MapServer(string id) { + if (m_UriMap.Count == 0) + return m_ServerURI; + UriBuilder serverUri = new UriBuilder(m_ServerURI); string prefix = id.Substring(0, 2).ToLower(); @@ -164,7 +167,9 @@ namespace OpenSim.Services.Connectors protected void retryCheck(object source, ElapsedEventArgs e) { m_retryCounter++; - if (m_retryCounter > 60) m_retryCounter -= 60; + if (m_retryCounter > 60) + m_retryCounter -= 60; + List keys = new List(); foreach (int a in m_retryQueue.Keys) { @@ -282,19 +287,19 @@ namespace OpenSim.Services.Connectors rc.RequestMethod = "GET"; - Stream s = rc.Request(m_Auth); - - if (s == null) - return null; - - if (s.Length > 0) + using (Stream s = rc.Request(m_Auth)) { - byte[] ret = new byte[s.Length]; - s.Read(ret, 0, (int)s.Length); + if (s == null) + return null; - return ret; - } + if (s.Length > 0) + { + byte[] ret = new byte[s.Length]; + s.Read(ret, 0, (int)s.Length); + return ret; + } + } return null; } } -- cgit v1.1