From 630ce5b26446883043aa5e6541a4550d0e918659 Mon Sep 17 00:00:00 2001
From: Dahlia Trimble
Date: Sat, 10 Jan 2009 09:15:23 +0000
Subject: Revert progressive texture patch from r8001 until issues can be
addressed
---
.../Agent/TextureDownload/TextureDownloadModule.cs | 62 ++++++++++------------
.../Agent/TextureDownload/TextureNotFoundSender.cs | 21 ++++----
.../TextureDownload/UserTextureDownloadService.cs | 31 +++++------
3 files changed, 54 insertions(+), 60 deletions(-)
(limited to 'OpenSim/Region/Environment/Modules/Agent/TextureDownload')
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index 2f5ea23..6bb61e2 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -204,14 +204,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
///
public void TextureRequest(Object sender, TextureRequestArgs e)
{
- IClientAPI client = (IClientAPI) sender;
+ IClientAPI client = (IClientAPI)sender;
if (e.Priority == 1016001f) // Preview
{
if (client.Scene is Scene)
{
Scene scene = (Scene)client.Scene;
-
+
CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);
if (profile == null) // Deny unknown user
return;
@@ -241,52 +241,44 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
{
ITextureSender sender = null;
-// try
-// {
+ try
+ {
while (true)
{
- try
+ sender = m_queueSenders.Dequeue();
+
+ if (sender.Cancel)
{
- sender = m_queueSenders.Dequeue();
+ TextureSent(sender);
- if (sender.Cancel)
+ sender.Cancel = false;
+ }
+ else
+ {
+ bool finished = sender.SendTexturePacket();
+ if (finished)
{
TextureSent(sender);
-
- sender.Cancel = false;
}
else
{
- bool finished = sender.SendTexturePacket();
- if (finished)
- {
- TextureSent(sender);
- }
- else
- {
- m_queueSenders.Enqueue(sender);
- }
+ m_queueSenders.Enqueue(sender);
}
+ }
- // Make sure that any sender we currently have can get garbage collected
- sender = null;
+ // Make sure that any sender we currently have can get garbage collected
+ sender = null;
- //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
- }
- catch(Exception e)
- {
- m_log.ErrorFormat(
- "[TEXTURE]: Texture send thread caught exception. The texture send was aborted. Exception is {0}", e);
- }
+ //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
}
-// }
-// catch (Exception e)
-// {
-// // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
-// m_log.ErrorFormat(
-// "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
-// e);
-// }
+ }
+ catch (Exception e)
+ {
+ // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
+ m_log.ErrorFormat(
+ "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
+ e);
+ }
}
///
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
index 044ee76..34ddee6 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
@@ -28,6 +28,7 @@
using System.Reflection;
using log4net;
using OpenMetaverse;
+using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
@@ -38,11 +39,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
///
public class TextureNotFoundSender : ITextureSender
{
-// private static readonly log4net.ILog m_log
-// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+ // private static readonly log4net.ILog m_log
+ // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-// private IClientAPI m_client;
-// private UUID m_textureId;
+ // private IClientAPI m_client;
+ // private UUID m_textureId;
public TextureNotFoundSender(IClientAPI client, UUID textureID)
{
@@ -55,13 +56,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
public bool Sending
{
get { return false; }
- set {}
+ set { }
}
public bool Cancel
{
get { return false; }
- set {}
+ set { }
}
// See ITextureSender
@@ -73,13 +74,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
// See ITextureSender
public bool SendTexturePacket()
{
-// m_log.DebugFormat(
-// "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found",
-// m_textureId);
+ // m_log.DebugFormat(
+ // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found",
+ // m_textureId);
// XXX Temporarily disabling as this appears to be causing client crashes on at least
// 1.19.0(5) of the Linden Second Life client.
-// m_client.SendImageNotFound(m_textureId);
+ // m_client.SendImageNotFound(m_textureId);
return true;
}
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
index aab4ad0..e0790a2 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
@@ -56,10 +56,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
///
/// We will allow the client to request the same texture n times before dropping further requests
///
- /// This number contains repeated requests for the same texture at different resolutions (which
- /// are handled since r7368). However, this situation should be handled in a more sophisticated way.
+ /// This number includes repeated requests for the same texture at different resolutions (which we don't
+ /// currently handle properly as far as I know). However, this situation should be handled in a more
+ /// sophisticated way.
///
- private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 15;
+ private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5;
///
/// XXX Also going to limit requests for found textures.
@@ -119,13 +120,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
}
else
{
-// m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID);
-
+ // m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID);
+
if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
{
-// m_log.DebugFormat(
-// "[TEXTURE]: Refusing request for {0} from client {1}",
-// e.RequestedAssetID, m_client.AgentId);
+ // m_log.DebugFormat(
+ // "[TEXTURE]: Refusing request for {0} from client {1}",
+ // e.RequestedAssetID, m_client.AgentId);
return;
}
@@ -138,9 +139,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
// Commenting out this message for now as it causes too much noise with other
// debug messages.
-// m_log.DebugFormat(
-// "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests",
-// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
+ // m_log.DebugFormat(
+ // "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests",
+ // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
}
return;
@@ -148,7 +149,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
m_scene.AddPendingDownloads(1);
- TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber, e.Priority);
+ TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber);
m_textureSenders.Add(e.RequestedAssetID, requestHandler);
m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true);
@@ -195,9 +196,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
{
missingTextureLimitStrategy.MonitorRequests(textureID);
-// m_log.DebugFormat(
-// "[TEXTURE]: Queueing first TextureNotFoundSender for {0}, client {1}",
-// textureID, m_client.AgentId);
+ // m_log.DebugFormat(
+ // "[TEXTURE]: Queueing first TextureNotFoundSender for {0}, client {1}",
+ // textureID, m_client.AgentId);
}
ITextureSender textureNotFoundSender = new TextureNotFoundSender(m_client, textureID);
--
cgit v1.1