From 65862aaceadc69218895e07b5d547266b12916a9 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 25 Feb 2008 23:26:35 +0000 Subject: * 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 --- .../Framework/Communications/Cache/AssetCache.cs | 32 ++++++---------------- 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'OpenSim/Framework') 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 /// If the asset was not found this is still called with the asset UUID but with a null asset data reference public void GetAsset(LLUUID assetId, AssetRequestCallback callback, bool isTexture) { + #if DEBUG + //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); + #endif + AssetBase asset; if (TryGetCachedAsset(assetId, out asset)) @@ -249,11 +253,11 @@ namespace OpenSim.Framework.Communications.Cache callback(assetId, asset); } else - { + { #if DEBUG //m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); #endif - + NewAssetRequest req = new NewAssetRequest(assetId, callback); // Make sure we always have a request list to which to add the asset @@ -395,7 +399,7 @@ namespace OpenSim.Framework.Communications.Cache public void AssetReceived(AssetBase asset, bool IsTexture) { #if DEBUG - m_log.DebugFormat("[ASSET CACHE]: Received {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); + //m_log.DebugFormat("[ASSET CACHE]: Received {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); #endif 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 // See IAssetReceiver public void AssetNotFound(LLUUID assetID) { - //m_log.ErrorFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); - - // The 'image not found' packet needs to happen, but RequestedTextures is not actually used (should be cleaned up) - // It might also be better to do this in the TextureDownloadModule - /* - * - AssetRequest req; - - if (RequestedTextures.TryGetValue(assetID, out req)) - { - m_log.WarnFormat("[ASSET CACHE]: sending image not found for {0}", assetID); - ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); - notFound.ImageID.ID = assetID; - req.RequestUser.OutPacket(notFound, ThrottleOutPacketType.Unknown); - RequestedTextures.Remove(assetID); - } - else - { - m_log.ErrorFormat("[ASSET CACHE]: Asset [{0}] not found, but couldn't find any users to send to ", assetID); - } - */ + m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); // Notify requesters for this asset lock (RequestLists) -- cgit v1.1