From 5fe4a39927754ce797aa728ed41d189cab95b058 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 3 Apr 2008 15:28:50 +0000 Subject: * Adding request time limiting strategy for texture requests, though this isn't useable yet --- .../Environment/Modules/UserTextureDownloadService.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs index 62904d8..f0a2517 100644 --- a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs @@ -50,12 +50,16 @@ namespace OpenSim.Region.Environment.Modules = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); /// - /// We will allow the client to request the same texture n times before dropping further requests + /// We will allow the client to request the same missing texture n times before dropping further requests + /// + /// 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 = 5; /// - /// We're going to limit repeated requests for the same missing texture. + /// We're going to limit requests for the same missing texture. /// XXX This is really a temporary solution to deal with the situation where a client continually requests /// the same missing textures /// @@ -63,10 +67,10 @@ namespace OpenSim.Region.Environment.Modules = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); /// - /// XXX Also going to limit repeated requests for found textures. + /// XXX Also going to limit requests for found textures. /// private readonly IRequestLimitStrategy foundTextureLimitStrategy - = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); + = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); /// /// Holds texture senders before they have received the appropriate texture from the asset cache. @@ -115,6 +119,10 @@ namespace OpenSim.Region.Environment.Modules { if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) { +// m_log.DebugFormat( +// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}", +// e.RequestedAssetID, m_client.AgentId); + return; } else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) -- cgit v1.1