diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 51 |
1 files changed, 17 insertions, 34 deletions
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 | |||
347 | string uri = r.uri; | 347 | string uri = r.uri; |
348 | string id = r.id; | 348 | string id = r.id; |
349 | 349 | ||
350 | bool success = false; | ||
351 | try | 350 | try |
352 | { | 351 | { |
353 | AssetBase a = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 30000, m_Auth); | 352 | AssetBase a = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 30000, m_Auth); |
354 | if (a != null) | ||
355 | { | ||
356 | if (m_Cache != null) | ||
357 | m_Cache.Cache(a); | ||
358 | 353 | ||
359 | List<AssetRetrievedEx> handlers; | 354 | if (a != null && m_Cache != null) |
360 | lock (m_AssetHandlers) | 355 | m_Cache.Cache(a); |
361 | { | ||
362 | handlers = m_AssetHandlers[id]; | ||
363 | m_AssetHandlers.Remove(id); | ||
364 | } | ||
365 | 356 | ||
366 | if(handlers != null) | 357 | List<AssetRetrievedEx> handlers; |
367 | { | 358 | lock (m_AssetHandlers) |
368 | Util.FireAndForget(x => | 359 | { |
369 | { | 360 | handlers = m_AssetHandlers[id]; |
370 | foreach (AssetRetrievedEx h in handlers) | 361 | m_AssetHandlers.Remove(id); |
371 | { | ||
372 | try { h.Invoke(a); } | ||
373 | catch { } | ||
374 | } | ||
375 | handlers.Clear(); | ||
376 | }); | ||
377 | } | ||
378 | success = true; | ||
379 | } | 362 | } |
380 | } | 363 | |
381 | finally | 364 | if(handlers != null) |
382 | { | ||
383 | if (!success) | ||
384 | { | 365 | { |
385 | List<AssetRetrievedEx> handlers; | 366 | Util.FireAndForget(x => |
386 | lock (m_AssetHandlers) | ||
387 | { | 367 | { |
388 | handlers = m_AssetHandlers[id]; | 368 | foreach (AssetRetrievedEx h in handlers) |
389 | m_AssetHandlers.Remove(id); | 369 | { |
390 | } | 370 | try { h.Invoke(a); } |
391 | if (handlers != null) | 371 | catch { } |
372 | } | ||
392 | handlers.Clear(); | 373 | handlers.Clear(); |
374 | }); | ||
393 | } | 375 | } |
394 | } | 376 | } |
377 | catch { } | ||
395 | } | 378 | } |
396 | } | 379 | } |
397 | 380 | ||