From 63ddbfb97982335f947a58f1fe8d03d3403276ed Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 16 May 2008 18:10:04 +0000 Subject: * Eliminate occurences of "Got a texture uuid ... with no sender object to handle it..." by properly dealing with the situation where a client still has queued texture requests when it logs out --- OpenSim/Framework/Communications/Cache/AssetCache.cs | 2 +- .../TextureDownload/UserTextureDownloadService.cs | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index e6a0852..1dd6529 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -453,7 +453,7 @@ namespace OpenSim.Framework.Communications.Cache // See IAssetReceiver public void AssetNotFound(LLUUID assetID, bool IsTexture) { - m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); + //m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); if (IsTexture) { diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 42624ad..10ef766 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -46,6 +46,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + /// + /// True if the service has been closed, probably because a user with texture requests still queued + /// logged out. + /// + private bool closed; /// /// We will allow the client to request the same texture n times before dropping further requests @@ -169,11 +175,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload public void TextureCallback(LLUUID textureID, AssetBase texture) { //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); + + // There may still be texture requests pending for a logged out client + if (closed) + return; lock (m_textureSenders) { TextureSender.TextureSender textureSender; - if (m_textureSenders.TryGetValue(textureID, out textureSender)) { // XXX It may be perfectly valid for a texture to have no data... but if we pass @@ -211,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload else { m_log.WarnFormat( - "Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", + "[USER TEXTURE DOWNLOAD SERVICE]: Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", textureID); } } @@ -237,6 +246,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// internal void Close() { + closed = true; + lock (m_textureSenders) { foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) @@ -246,6 +257,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload m_textureSenders.Clear(); } + + // XXX: It might be possible to also remove pending texture requests from the asset cache queues, + // though this might also be more trouble than it's worth. } } } -- cgit v1.1