From d2e380e81e549ccce316ef873502f66ba6806642 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Nov 2016 16:56:09 +0000 Subject: on get asset with callback, do the callback even if asset not found. This is needed on same cases --- .../Connectors/Asset/AssetServicesConnector.cs | 51 ++++++++-------------- 1 file changed, 17 insertions(+), 34 deletions(-) (limited to 'OpenSim/Services/Connectors/Asset') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 99119d3..a6e8eb4 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -347,51 +347,34 @@ namespace OpenSim.Services.Connectors string uri = r.uri; string id = r.id; - bool success = false; try { AssetBase a = SynchronousRestObjectRequester.MakeRequest("GET", uri, 0, 30000, m_Auth); - if (a != null) - { - if (m_Cache != null) - m_Cache.Cache(a); - List handlers; - lock (m_AssetHandlers) - { - handlers = m_AssetHandlers[id]; - m_AssetHandlers.Remove(id); - } + if (a != null && m_Cache != null) + m_Cache.Cache(a); - if(handlers != null) - { - Util.FireAndForget(x => - { - foreach (AssetRetrievedEx h in handlers) - { - try { h.Invoke(a); } - catch { } - } - handlers.Clear(); - }); - } - success = true; + List handlers; + lock (m_AssetHandlers) + { + handlers = m_AssetHandlers[id]; + m_AssetHandlers.Remove(id); } - } - finally - { - if (!success) + + if(handlers != null) { - List handlers; - lock (m_AssetHandlers) + Util.FireAndForget(x => { - handlers = m_AssetHandlers[id]; - m_AssetHandlers.Remove(id); - } - if (handlers != null) + foreach (AssetRetrievedEx h in handlers) + { + try { h.Invoke(a); } + catch { } + } handlers.Clear(); + }); } } + catch { } } } -- cgit v1.1