aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-02-25 23:26:35 +0000
committerJustin Clarke Casey2008-02-25 23:26:35 +0000
commit65862aaceadc69218895e07b5d547266b12916a9 (patch)
tree67449a6fe51b5c86cc14e75a41589cbaa2c5be5b /OpenSim/Framework
parentMoved AsyncCommandManager into separate classes under "plugins". (diff)
downloadopensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.zip
opensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.tar.gz
opensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.tar.bz2
opensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.tar.xz
* Start sending "ImageNotFound" packet back to the client if we can't find an image
* This might stop some client's constant requests for unfound textures, which is a candidate for the memory leak * If a texture is not found then the "Image not found" texture will now be displayed clientside * If it works, this should resolve mantis 676 * Non texture image requests do not receive this packet yet * This will require a prebuild
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs32
1 files changed, 8 insertions, 24 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index e3a4eb8..d04708d 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -242,6 +242,10 @@ namespace OpenSim.Framework.Communications.Cache
242 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param> 242 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference</param>
243 public void GetAsset(LLUUID assetId, AssetRequestCallback callback, bool isTexture) 243 public void GetAsset(LLUUID assetId, AssetRequestCallback callback, bool isTexture)
244 { 244 {
245 #if DEBUG
246 //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId);
247 #endif
248
245 AssetBase asset; 249 AssetBase asset;
246 250
247 if (TryGetCachedAsset(assetId, out asset)) 251 if (TryGetCachedAsset(assetId, out asset))
@@ -249,11 +253,11 @@ namespace OpenSim.Framework.Communications.Cache
249 callback(assetId, asset); 253 callback(assetId, asset);
250 } 254 }
251 else 255 else
252 { 256 {
253 #if DEBUG 257 #if DEBUG
254 //m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); 258 //m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId);
255 #endif 259 #endif
256 260
257 NewAssetRequest req = new NewAssetRequest(assetId, callback); 261 NewAssetRequest req = new NewAssetRequest(assetId, callback);
258 262
259 // Make sure we always have a request list to which to add the asset 263 // Make sure we always have a request list to which to add the asset
@@ -395,7 +399,7 @@ namespace OpenSim.Framework.Communications.Cache
395 public void AssetReceived(AssetBase asset, bool IsTexture) 399 public void AssetReceived(AssetBase asset, bool IsTexture)
396 { 400 {
397 #if DEBUG 401 #if DEBUG
398 m_log.DebugFormat("[ASSET CACHE]: Received {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); 402 //m_log.DebugFormat("[ASSET CACHE]: Received {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID);
399 #endif 403 #endif
400 404
401 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server 405 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
@@ -479,27 +483,7 @@ namespace OpenSim.Framework.Communications.Cache
479 // See IAssetReceiver 483 // See IAssetReceiver
480 public void AssetNotFound(LLUUID assetID) 484 public void AssetNotFound(LLUUID assetID)
481 { 485 {
482 //m_log.ErrorFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); 486 m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
483
484 // The 'image not found' packet needs to happen, but RequestedTextures is not actually used (should be cleaned up)
485 // It might also be better to do this in the TextureDownloadModule
486 /*
487 *
488 AssetRequest req;
489
490 if (RequestedTextures.TryGetValue(assetID, out req))
491 {
492 m_log.WarnFormat("[ASSET CACHE]: sending image not found for {0}", assetID);
493 ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
494 notFound.ImageID.ID = assetID;
495 req.RequestUser.OutPacket(notFound, ThrottleOutPacketType.Unknown);
496 RequestedTextures.Remove(assetID);
497 }
498 else
499 {
500 m_log.ErrorFormat("[ASSET CACHE]: Asset [{0}] not found, but couldn't find any users to send to ", assetID);
501 }
502 */
503 487
504 // Notify requesters for this asset 488 // Notify requesters for this asset
505 lock (RequestLists) 489 lock (RequestLists)