diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 28 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 16 |
2 files changed, 33 insertions, 11 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 | { |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 121e863..953bc2a 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -136,7 +136,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
136 | // Cache fetch | 136 | // Cache fetch |
137 | if (m_cache != null) | 137 | if (m_cache != null) |
138 | { | 138 | { |
139 | AssetBase asset = m_cache.Get(id); | 139 | AssetBase asset; |
140 | if (!m_cache.Get(id, out asset)) | ||
141 | return null; | ||
140 | if (asset != null) | 142 | if (asset != null) |
141 | return asset; | 143 | return asset; |
142 | } | 144 | } |
@@ -147,8 +149,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
147 | 149 | ||
148 | public AssetBase GetCached(string id) | 150 | public AssetBase GetCached(string id) |
149 | { | 151 | { |
152 | AssetBase asset; | ||
150 | if (m_cache != null) | 153 | if (m_cache != null) |
151 | return m_cache.Get(id); | 154 | m_cache.Get(id, out asset); |
152 | 155 | ||
153 | return null; | 156 | return null; |
154 | } | 157 | } |
@@ -169,7 +172,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
169 | // Cache fetch | 172 | // Cache fetch |
170 | if (m_cache != null) | 173 | if (m_cache != null) |
171 | { | 174 | { |
172 | AssetBase asset = m_cache.Get(id); | 175 | AssetBase asset; |
176 | if (!m_cache.Get(id, out asset)) | ||
177 | return null; | ||
173 | if (asset != null) | 178 | if (asset != null) |
174 | return asset.Metadata; | 179 | return asset.Metadata; |
175 | } | 180 | } |
@@ -212,7 +217,10 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
212 | // Cache fetch | 217 | // Cache fetch |
213 | if (m_cache != null) | 218 | if (m_cache != null) |
214 | { | 219 | { |
215 | AssetBase asset = m_cache.Get(id); | 220 | AssetBase asset; |
221 | if (!m_cache.Get(id, out asset)) | ||
222 | return false; | ||
223 | |||
216 | if (asset != null) | 224 | if (asset != null) |
217 | { | 225 | { |
218 | handler(id, sender, asset); | 226 | handler(id, sender, asset); |