diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 9d6d9ad..7f32ad3 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -295,25 +295,30 @@ namespace OpenSim.Services.Connectors | |||
295 | bool success = false; | 295 | bool success = false; |
296 | try | 296 | try |
297 | { | 297 | { |
298 | AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, | 298 | AssetBase a = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 30); |
299 | delegate(AssetBase a) | 299 | if (a != null) |
300 | { | 300 | { |
301 | if (m_Cache != null) | 301 | if (m_Cache != null) |
302 | m_Cache.Cache(a); | 302 | m_Cache.Cache(a); |
303 | 303 | ||
304 | List<AssetRetrievedEx> handlers; | 304 | List<AssetRetrievedEx> handlers; |
305 | lock (m_AssetHandlers) | 305 | lock (m_AssetHandlers) |
306 | { | ||
307 | handlers = m_AssetHandlers[id]; | ||
308 | m_AssetHandlers.Remove(id); | ||
309 | } | ||
310 | foreach (AssetRetrievedEx h in handlers) | ||
311 | { | ||
312 | Util.FireAndForget(x => | ||
306 | { | 313 | { |
307 | handlers = m_AssetHandlers[id]; | ||
308 | m_AssetHandlers.Remove(id); | ||
309 | } | ||
310 | foreach (AssetRetrievedEx h in handlers) | ||
311 | h.Invoke(a); | 314 | h.Invoke(a); |
312 | if (handlers != null) | 315 | }); |
313 | handlers.Clear(); | 316 | } |
314 | }, 30); | 317 | if (handlers != null) |
318 | handlers.Clear(); | ||
315 | 319 | ||
316 | success = true; | 320 | success = true; |
321 | } | ||
317 | } | 322 | } |
318 | finally | 323 | finally |
319 | { | 324 | { |
@@ -326,7 +331,7 @@ namespace OpenSim.Services.Connectors | |||
326 | m_AssetHandlers.Remove(id); | 331 | m_AssetHandlers.Remove(id); |
327 | } | 332 | } |
328 | if (handlers != null) | 333 | if (handlers != null) |
329 | handlers.Clear(); | 334 | handlers.Clear(); |
330 | } | 335 | } |
331 | } | 336 | } |
332 | } | 337 | } |