aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-03 15:28:50 +0000
committerJustin Clarke Casey2008-04-03 15:28:50 +0000
commit5fe4a39927754ce797aa728ed41d189cab95b058 (patch)
tree60ce61ee52f62895f7d5e9c8b12f1cfb924b40c3 /OpenSim/Region
parent* Resolve mantis 849 (diff)
downloadopensim-SC_OLD-5fe4a39927754ce797aa728ed41d189cab95b058.zip
opensim-SC_OLD-5fe4a39927754ce797aa728ed41d189cab95b058.tar.gz
opensim-SC_OLD-5fe4a39927754ce797aa728ed41d189cab95b058.tar.bz2
opensim-SC_OLD-5fe4a39927754ce797aa728ed41d189cab95b058.tar.xz
* Adding request time limiting strategy for texture requests, though this isn't useable yet
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs16
1 files changed, 12 insertions, 4 deletions
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
50 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 50 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
51 51
52 /// <summary> 52 /// <summary>
53 /// We will allow the client to request the same texture n times before dropping further requests 53 /// We will allow the client to request the same missing texture n times before dropping further requests
54 ///
55 /// This number includes repeated requests for the same texture at different resolutions (which we don't
56 /// currently handle properly as far as I know). However, this situation should be handled in a more
57 /// sophisticated way.
54 /// </summary> 58 /// </summary>
55 private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; 59 private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5;
56 60
57 /// <summary> 61 /// <summary>
58 /// We're going to limit repeated requests for the same missing texture. 62 /// We're going to limit requests for the same missing texture.
59 /// XXX This is really a temporary solution to deal with the situation where a client continually requests 63 /// XXX This is really a temporary solution to deal with the situation where a client continually requests
60 /// the same missing textures 64 /// the same missing textures
61 /// </summary> 65 /// </summary>
@@ -63,10 +67,10 @@ namespace OpenSim.Region.Environment.Modules
63 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS); 67 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
64 68
65 /// <summary> 69 /// <summary>
66 /// XXX Also going to limit repeated requests for found textures. 70 /// XXX Also going to limit requests for found textures.
67 /// </summary> 71 /// </summary>
68 private readonly IRequestLimitStrategy<LLUUID> foundTextureLimitStrategy 72 private readonly IRequestLimitStrategy<LLUUID> foundTextureLimitStrategy
69 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS); 73 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
70 74
71 /// <summary> 75 /// <summary>
72 /// Holds texture senders before they have received the appropriate texture from the asset cache. 76 /// Holds texture senders before they have received the appropriate texture from the asset cache.
@@ -115,6 +119,10 @@ namespace OpenSim.Region.Environment.Modules
115 { 119 {
116 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) 120 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
117 { 121 {
122// m_log.DebugFormat(
123// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}",
124// e.RequestedAssetID, m_client.AgentId);
125
118 return; 126 return;
119 } 127 }
120 else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) 128 else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID))