* Reduce the annoyingness of clients that continually request unfound textures (probably for some good reason) by dropping all subsequent requests after the first reply.

* Print out a console message every 20 tries rather than every single one.
* This weakens the problem but does not eliminate it
0.6.0-stable
Justin Clarke Casey 2008-03-17 17:30:01 +00:00
parent 7d1dcf3e68
commit cd1978b424
1 changed files with 34 additions and 6 deletions

View File

@ -60,6 +60,13 @@ namespace OpenSim.Region.Environment.Modules
/// </summary>
private readonly BlockingQueue<ITextureSender> m_sharedSendersQueue;
/// <summary>
/// We're going to record when we get a request for a particular missing texture for each client
/// XXX This is really a temporary solution to deal with the situation where a client continually requests
/// the same missing textures
/// </summary>
private readonly Dictionary<LLUUID, int> missingTextureRequests = new Dictionary<LLUUID, int>();
private readonly Scene m_scene;
private readonly IClientAPI m_client;
@ -137,6 +144,12 @@ namespace OpenSim.Region.Environment.Modules
// this on to the TextureSender it will blow up, so just discard for now.
// Needs investigation.
if (texture == null || texture.Data == null)
{
// We're only going to tell the client once about a missing texture, even if it keeps asking
// XXX This is to reduce (but not resolve) a current problem where some clients keep requesting the same textures
// - one might want to do this for all asset requests (or allow a number of retries) in the
// longer term.
if (!missingTextureRequests.ContainsKey(textureID))
{
m_log.DebugFormat(
"[USER TEXTURE DOWNLOAD SERVICE]: Queueing TextureNotFoundSender for {0}, client {1}",
@ -144,6 +157,21 @@ namespace OpenSim.Region.Environment.Modules
ITextureSender textureNotFoundSender = new TextureNotFoundSender(m_client, textureID);
EnqueueTextureSender(textureNotFoundSender);
missingTextureRequests.Add(textureID, 1);
}
else
{
int requests = missingTextureRequests[textureID] + 1;
if (requests % 20 == 0)
{
m_log.WarnFormat(
"[USER TEXTURE DOWNLOAD SERVICE]: Received {0} requests for the missing texture {1} from client {2}",
requests, textureID, m_client.AgentId);
}
missingTextureRequests[textureID] = requests;
}
}
else
{