aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-30 13:59:05 +0000
committerMelanie Thielker2017-01-30 13:59:05 +0000
commit5a18ea31cf9d9a97fc1a65f8623b633c244221c2 (patch)
tree80eae98cddde4ffbdb7287ad0ac82449c33cb316 /OpenSim/Services/Connectors
parentComment two very spammy debug messages that the usr can't do anything about (diff)
downloadopensim-SC_OLD-5a18ea31cf9d9a97fc1a65f8623b633c244221c2.zip
opensim-SC_OLD-5a18ea31cf9d9a97fc1a65f8623b633c244221c2.tar.gz
opensim-SC_OLD-5a18ea31cf9d9a97fc1a65f8623b633c244221c2.tar.bz2
opensim-SC_OLD-5a18ea31cf9d9a97fc1a65f8623b633c244221c2.tar.xz
Make negative asset caching actually work
Also fixes some merge artefacts in HGAssetBroker where cached assets were requested but not actually used and completely squelch a materials debug message because there is nothing the user can do to fix it anyway.
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs37
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs20
2 files changed, 47 insertions, 10 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 3fa8b54..9595e7b 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -243,8 +243,16 @@ 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 bool negative;
250
251 asset = m_Cache.Get(id, out negative);
252
253 if (negative)
254 return null;
255 }
248 256
249 if (asset == null || asset.Data == null || asset.Data.Length == 0) 257 if (asset == null || asset.Data == null || asset.Data.Length == 0)
250 { 258 {
@@ -275,8 +283,9 @@ namespace OpenSim.Services.Connectors
275 { 283 {
276// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id); 284// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id);
277 285
286 bool negative;
278 if (m_Cache != null) 287 if (m_Cache != null)
279 return m_Cache.Get(id); 288 return m_Cache.Get(id, out negative);
280 289
281 return null; 290 return null;
282 } 291 }
@@ -285,7 +294,11 @@ namespace OpenSim.Services.Connectors
285 { 294 {
286 if (m_Cache != null) 295 if (m_Cache != null)
287 { 296 {
288 AssetBase fullAsset = m_Cache.Get(id); 297 bool negative;
298 AssetBase fullAsset = m_Cache.Get(id, out negative);
299
300 if (negative)
301 return null;
289 302
290 if (fullAsset != null) 303 if (fullAsset != null)
291 return fullAsset.Metadata; 304 return fullAsset.Metadata;
@@ -301,7 +314,11 @@ namespace OpenSim.Services.Connectors
301 { 314 {
302 if (m_Cache != null) 315 if (m_Cache != null)
303 { 316 {
304 AssetBase fullAsset = m_Cache.Get(id); 317 bool negative;
318 AssetBase fullAsset = m_Cache.Get(id, out negative);
319
320 if (negative)
321 return null;
305 322
306 if (fullAsset != null) 323 if (fullAsset != null)
307 return fullAsset.Data; 324 return fullAsset.Data;
@@ -389,7 +406,14 @@ namespace OpenSim.Services.Connectors
389 406
390 AssetBase asset = null; 407 AssetBase asset = null;
391 if (m_Cache != null) 408 if (m_Cache != null)
392 asset = m_Cache.Get(id); 409 {
410 bool negative;
411
412 asset = m_Cache.Get(id, out negative);
413
414 if (negative)
415 return false;
416 }
393 417
394 if (asset == null || asset.Data == null || asset.Data.Length == 0) 418 if (asset == null || asset.Data == null || asset.Data.Length == 0)
395 { 419 {
@@ -589,8 +613,9 @@ namespace OpenSim.Services.Connectors
589 { 613 {
590 AssetBase asset = null; 614 AssetBase asset = null;
591 615
616 bool negative;
592 if (m_Cache != null) 617 if (m_Cache != null)
593 asset = m_Cache.Get(id); 618 asset = m_Cache.Get(id, out negative);
594 619
595 if (asset == null) 620 if (asset == null)
596 { 621 {
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 121e863..af5f69a 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -136,7 +136,10 @@ 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 bool negative;
140 AssetBase asset = m_cache.Get(id, out negative);
141 if (negative)
142 return null;
140 if (asset != null) 143 if (asset != null)
141 return asset; 144 return asset;
142 } 145 }
@@ -147,8 +150,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
147 150
148 public AssetBase GetCached(string id) 151 public AssetBase GetCached(string id)
149 { 152 {
153 bool negative;
150 if (m_cache != null) 154 if (m_cache != null)
151 return m_cache.Get(id); 155 return m_cache.Get(id, out negative);
152 156
153 return null; 157 return null;
154 } 158 }
@@ -169,7 +173,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
169 // Cache fetch 173 // Cache fetch
170 if (m_cache != null) 174 if (m_cache != null)
171 { 175 {
172 AssetBase asset = m_cache.Get(id); 176 bool negative;
177 AssetBase asset = m_cache.Get(id, out negative);
178 if (negative)
179 return null;
173 if (asset != null) 180 if (asset != null)
174 return asset.Metadata; 181 return asset.Metadata;
175 } 182 }
@@ -212,7 +219,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
212 // Cache fetch 219 // Cache fetch
213 if (m_cache != null) 220 if (m_cache != null)
214 { 221 {
215 AssetBase asset = m_cache.Get(id); 222 bool negative;
223 AssetBase asset = m_cache.Get(id, out negative);
224
225 if (negative)
226 return false;
227
216 if (asset != null) 228 if (asset != null)
217 { 229 {
218 handler(id, sender, asset); 230 handler(id, sender, asset);