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 --- .../Environment/Modules/TextureDownloadModule.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/TextureDownloadModule.cs') diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index c773f9e..2b2ac42 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs @@ -52,7 +52,8 @@ namespace OpenSim.Region.Environment.Modules /// /// There is one queue for all textures waiting to be sent, regardless of the requesting user. /// - private readonly BlockingQueue m_queueSenders = new BlockingQueue(); + private readonly BlockingQueue m_queueSenders + = new BlockingQueue(); /// /// Each user has their own texture download service. @@ -135,17 +136,19 @@ namespace OpenSim.Region.Environment.Modules /// /// /// Always returns true, since a service is created if one does not already exist - private bool TryGetUserTextureService(LLUUID userID, out UserTextureDownloadService textureService) + private bool TryGetUserTextureService( + IClientAPI client, out UserTextureDownloadService textureService) { lock (m_userTextureServices) { - if (m_userTextureServices.TryGetValue(userID, out textureService)) + if (m_userTextureServices.TryGetValue(client.AgentId, out textureService)) { return true; } - textureService = new UserTextureDownloadService(m_scene, m_queueSenders); - m_userTextureServices.Add(userID, textureService); + textureService = new UserTextureDownloadService(client, m_scene, m_queueSenders); + m_userTextureServices.Add(client.AgentId, textureService); + return true; } } @@ -159,9 +162,10 @@ namespace OpenSim.Region.Environment.Modules { IClientAPI client = (IClientAPI) sender; UserTextureDownloadService textureService; - if (TryGetUserTextureService(client.AgentId, out textureService)) + + if (TryGetUserTextureService(client, out textureService)) { - textureService.HandleTextureRequest(client, e); + textureService.HandleTextureRequest(e); } } @@ -170,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules /// public void ProcessTextureSenders() { - TextureSender sender = null; + ITextureSender sender = null; while (true) { @@ -206,7 +210,7 @@ namespace OpenSim.Region.Environment.Modules /// Called when the texture has finished sending. /// /// - private void TextureSent(TextureSender sender) + private void TextureSent(ITextureSender sender) { sender.Sending = false; //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); -- cgit v1.1