diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 3fa8b54..810da2f 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -243,8 +243,12 @@ namespace OpenSim.Services.Connectors | |||
243 | string uri = MapServer(id) + "/assets/" + id; | 243 | string uri = MapServer(id) + "/assets/" + id; |
244 | 244 | ||
245 | AssetBase asset = null; | 245 | AssetBase asset = null; |
246 | |||
246 | if (m_Cache != null) | 247 | if (m_Cache != null) |
247 | asset = m_Cache.Get(id); | 248 | { |
249 | if (!m_Cache.Get(id, out asset)) | ||
250 | return null; | ||
251 | } | ||
248 | 252 | ||
249 | if (asset == null || asset.Data == null || asset.Data.Length == 0) | 253 | if (asset == null || asset.Data == null || asset.Data.Length == 0) |
250 | { | 254 | { |
@@ -275,17 +279,22 @@ namespace OpenSim.Services.Connectors | |||
275 | { | 279 | { |
276 | // m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id); | 280 | // m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id); |
277 | 281 | ||
282 | AssetBase asset = null; | ||
278 | if (m_Cache != null) | 283 | if (m_Cache != null) |
279 | return m_Cache.Get(id); | 284 | { |
285 | m_Cache.Get(id, out asset); | ||
286 | } | ||
280 | 287 | ||
281 | return null; | 288 | return asset; |
282 | } | 289 | } |
283 | 290 | ||
284 | public AssetMetadata GetMetadata(string id) | 291 | public AssetMetadata GetMetadata(string id) |
285 | { | 292 | { |
286 | if (m_Cache != null) | 293 | if (m_Cache != null) |
287 | { | 294 | { |
288 | AssetBase fullAsset = m_Cache.Get(id); | 295 | AssetBase fullAsset; |
296 | if (!m_Cache.Get(id, out fullAsset)) | ||
297 | return null; | ||
289 | 298 | ||
290 | if (fullAsset != null) | 299 | if (fullAsset != null) |
291 | return fullAsset.Metadata; | 300 | return fullAsset.Metadata; |
@@ -301,7 +310,9 @@ namespace OpenSim.Services.Connectors | |||
301 | { | 310 | { |
302 | if (m_Cache != null) | 311 | if (m_Cache != null) |
303 | { | 312 | { |
304 | AssetBase fullAsset = m_Cache.Get(id); | 313 | AssetBase fullAsset; |
314 | if (!m_Cache.Get(id, out fullAsset)) | ||
315 | return null; | ||
305 | 316 | ||
306 | if (fullAsset != null) | 317 | if (fullAsset != null) |
307 | return fullAsset.Data; | 318 | return fullAsset.Data; |
@@ -389,7 +400,10 @@ namespace OpenSim.Services.Connectors | |||
389 | 400 | ||
390 | AssetBase asset = null; | 401 | AssetBase asset = null; |
391 | if (m_Cache != null) | 402 | if (m_Cache != null) |
392 | asset = m_Cache.Get(id); | 403 | { |
404 | if (!m_Cache.Get(id, out asset)) | ||
405 | return false; | ||
406 | } | ||
393 | 407 | ||
394 | if (asset == null || asset.Data == null || asset.Data.Length == 0) | 408 | if (asset == null || asset.Data == null || asset.Data.Length == 0) |
395 | { | 409 | { |
@@ -590,7 +604,7 @@ namespace OpenSim.Services.Connectors | |||
590 | AssetBase asset = null; | 604 | AssetBase asset = null; |
591 | 605 | ||
592 | if (m_Cache != null) | 606 | if (m_Cache != null) |
593 | asset = m_Cache.Get(id); | 607 | m_Cache.Get(id, out asset); |
594 | 608 | ||
595 | if (asset == null) | 609 | if (asset == null) |
596 | { | 610 | { |