aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetCache.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetCache.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs46
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 76c6045..0e1f948 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -341,11 +341,11 @@ namespace OpenSim.Framework.Communications.Cache
341 /// <param name="asset"></param> 341 /// <param name="asset"></param>
342 public void AddAsset(AssetBase asset) 342 public void AddAsset(AssetBase asset)
343 { 343 {
344 if (!m_memcache.Contains(asset.Metadata.FullID)) 344 if (!m_memcache.Contains(asset.FullID))
345 { 345 {
346 m_log.Info("[CACHE] Caching " + asset.Metadata.FullID + " for 24 hours from last access"); 346 m_log.Info("[CACHE] Caching " + asset.FullID + " for 24 hours from last access");
347 // Use 24 hour rolling asset cache. 347 // Use 24 hour rolling asset cache.
348 m_memcache.AddOrUpdate(asset.Metadata.FullID, asset, TimeSpan.FromHours(24)); 348 m_memcache.AddOrUpdate(asset.FullID, asset, TimeSpan.FromHours(24));
349 349
350 // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the 350 // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the
351 // information is stored locally. It could disappear, in which case we could send the 351 // information is stored locally. It could disappear, in which case we could send the
@@ -365,7 +365,7 @@ namespace OpenSim.Framework.Communications.Cache
365 // But for now, we're going to take the easy way out and store local assets globally. 365 // But for now, we're going to take the easy way out and store local assets globally.
366 // 366 //
367 // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView. 367 // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView.
368 if (!asset.Metadata.Temporary || asset.Metadata.Local) 368 if (!asset.Temporary || asset.Local)
369 { 369 {
370 m_assetServer.StoreAsset(asset); 370 m_assetServer.StoreAsset(asset);
371 } 371 }
@@ -396,25 +396,25 @@ namespace OpenSim.Framework.Communications.Cache
396 { 396 {
397 397
398 AssetInfo assetInf = new AssetInfo(asset); 398 AssetInfo assetInf = new AssetInfo(asset);
399 if (!m_memcache.Contains(assetInf.Metadata.FullID)) 399 if (!m_memcache.Contains(assetInf.FullID))
400 { 400 {
401 m_memcache.AddOrUpdate(assetInf.Metadata.FullID, assetInf, TimeSpan.FromHours(24)); 401 m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24));
402 402
403 if (StatsManager.SimExtraStats != null) 403 if (StatsManager.SimExtraStats != null)
404 { 404 {
405 StatsManager.SimExtraStats.AddAsset(assetInf); 405 StatsManager.SimExtraStats.AddAsset(assetInf);
406 } 406 }
407 407
408 if (RequestedAssets.ContainsKey(assetInf.Metadata.FullID)) 408 if (RequestedAssets.ContainsKey(assetInf.FullID))
409 { 409 {
410 AssetRequest req = RequestedAssets[assetInf.Metadata.FullID]; 410 AssetRequest req = RequestedAssets[assetInf.FullID];
411 req.AssetInf = assetInf; 411 req.AssetInf = assetInf;
412 req.NumPackets = CalculateNumPackets(assetInf.Data); 412 req.NumPackets = CalculateNumPackets(assetInf.Data);
413 413
414 RequestedAssets.Remove(assetInf.Metadata.FullID); 414 RequestedAssets.Remove(assetInf.FullID);
415 // If it's a direct request for a script, drop it 415 // If it's a direct request for a script, drop it
416 // because it's a hacked client 416 // because it's a hacked client
417 if (req.AssetRequestSource != 2 || assetInf.Metadata.Type != 10) 417 if (req.AssetRequestSource != 2 || assetInf.Type != 10)
418 AssetRequests.Add(req); 418 AssetRequests.Add(req);
419 } 419 }
420 } 420 }
@@ -424,8 +424,8 @@ namespace OpenSim.Framework.Communications.Cache
424 424
425 lock (RequestLists) 425 lock (RequestLists)
426 { 426 {
427 if (RequestLists.TryGetValue(asset.Metadata.FullID, out reqList)) 427 if (RequestLists.TryGetValue(asset.FullID, out reqList))
428 RequestLists.Remove(asset.Metadata.FullID); 428 RequestLists.Remove(asset.FullID);
429 } 429 }
430 430
431 if (reqList != null) 431 if (reqList != null)
@@ -436,8 +436,8 @@ namespace OpenSim.Framework.Communications.Cache
436 foreach (NewAssetRequest req in reqList.Requests) 436 foreach (NewAssetRequest req in reqList.Requests)
437 { 437 {
438 // Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked 438 // Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked
439 // m_log.DebugFormat("[ASSET CACHE]: Callback for asset {0}", asset.Metadata.FullID); 439 // m_log.DebugFormat("[ASSET CACHE]: Callback for asset {0}", asset.FullID);
440 req.Callback(asset.Metadata.FullID, asset); 440 req.Callback(asset.FullID, asset);
441 } 441 }
442 } 442 }
443 } 443 }
@@ -545,7 +545,7 @@ namespace OpenSim.Framework.Communications.Cache
545 } 545 }
546 546
547 // Scripts cannot be retrieved by direct request 547 // Scripts cannot be retrieved by direct request
548 if (transferRequest.TransferInfo.SourceType == 2 && asset.Metadata.Type == 10) 548 if (transferRequest.TransferInfo.SourceType == 2 && asset.Type == 10)
549 return; 549 return;
550 550
551 // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list 551 // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list
@@ -631,10 +631,10 @@ namespace OpenSim.Framework.Communications.Cache
631 public AssetInfo(AssetBase aBase) 631 public AssetInfo(AssetBase aBase)
632 { 632 {
633 Data = aBase.Data; 633 Data = aBase.Data;
634 Metadata.FullID = aBase.Metadata.FullID; 634 FullID = aBase.FullID;
635 Metadata.Type = aBase.Metadata.Type; 635 Type = aBase.Type;
636 Metadata.Name = aBase.Metadata.Name; 636 Name = aBase.Name;
637 Metadata.Description = aBase.Metadata.Description; 637 Description = aBase.Description;
638 } 638 }
639 } 639 }
640 640
@@ -643,10 +643,10 @@ namespace OpenSim.Framework.Communications.Cache
643 public TextureImage(AssetBase aBase) 643 public TextureImage(AssetBase aBase)
644 { 644 {
645 Data = aBase.Data; 645 Data = aBase.Data;
646 Metadata.FullID = aBase.Metadata.FullID; 646 FullID = aBase.FullID;
647 Metadata.Type = aBase.Metadata.Type; 647 Type = aBase.Type;
648 Metadata.Name = aBase.Metadata.Name; 648 Name = aBase.Name;
649 Metadata.Description = aBase.Metadata.Description; 649 Description = aBase.Description;
650 } 650 }
651 } 651 }
652 652