* Remove and comment out old and unneeded parts of the old TextureDownload and UserTextureDownloadService modules.

* These have been mostly replaced by the PriorityQueue sender in LLClientView (it was still using threads and poll processing!)
* Thread Reduction!
* Might have been sending more image packets then necessary previously, texture times 2.    We'll see if this reduces the texture packet load.
trunk
Teravus Ovares 2009-07-30 06:27:45 +00:00
parent 07579fa402
commit a8246bc57e
2 changed files with 39 additions and 48 deletions

View File

@ -60,8 +60,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
private Scene m_scene; private Scene m_scene;
private List<Scene> m_scenes = new List<Scene>(); private List<Scene> m_scenes = new List<Scene>();
private Thread m_thread;
public TextureDownloadModule() public TextureDownloadModule()
{ {
} }
@ -70,15 +68,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
if (m_scene == null) if (m_scene == null)
{ {
//m_log.Debug("Creating Texture download module"); //m_log.Debug("Creating Texture download module");
m_scene = scene; m_scene = scene;
m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); //m_thread = new Thread(new ThreadStart(ProcessTextureSenders));
m_thread.Name = "ProcessTextureSenderThread"; //m_thread.Name = "ProcessTextureSenderThread";
m_thread.IsBackground = true; //m_thread.IsBackground = true;
m_thread.Start(); //m_thread.Start();
ThreadTracker.Add(m_thread); //ThreadTracker.Add(m_thread);
} }
if (!m_scenes.Contains(scene)) if (!m_scenes.Contains(scene))

View File

@ -106,67 +106,57 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
/// <param name="e"></param> /// <param name="e"></param>
public void HandleTextureRequest(TextureRequestArgs e) public void HandleTextureRequest(TextureRequestArgs e)
{ {
TextureSender.TextureSender textureSender;
//TextureSender.TextureSender textureSender;
//TODO: should be working out the data size/ number of packets to be sent for each discard level //TODO: should be working out the data size/ number of packets to be sent for each discard level
if ((e.DiscardLevel >= 0) || (e.Priority != 0)) //if ((e.DiscardLevel >= 0) || (e.Priority != 0))
{ //{
lock (m_textureSenders) //lock (m_textureSenders)
{ //{
if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) //if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender))
{ //{
// If we've received new non UUID information for this request and it hasn't dispatched // If we've received new non UUID information for this request and it hasn't dispatched
// yet, then update the request accordingly. // yet, then update the request accordingly.
textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); // textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber);
} //}
else //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)) //if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
{ //{
// m_log.DebugFormat( // m_log.DebugFormat(
// "[TEXTURE]: Refusing request for {0} from client {1}", // "[TEXTURE]: Refusing request for {0} from client {1}",
// e.RequestedAssetID, m_client.AgentId); // e.RequestedAssetID, m_client.AgentId);
return; //return;
} //}
else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) //else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
{ //{
if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID)) // if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID))
{ // {
if (StatsManager.SimExtraStats != null) // if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); // StatsManager.SimExtraStats.AddBlockedMissingTextureRequest();
// Commenting out this message for now as it causes too much noise with other // Commenting out this message for now as it causes too much noise with other
// debug messages. // debug messages.
// m_log.DebugFormat( // m_log.DebugFormat(
// "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", // "[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); // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
} // }
return; // return;
} //}
m_scene.StatsReporter.AddPendingDownloads(1); m_scene.StatsReporter.AddPendingDownloads(1);
TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); //TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber);
m_textureSenders.Add(e.RequestedAssetID, requestHandler); //m_textureSenders.Add(e.RequestedAssetID, null);
m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived); m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived);
}
}
}
else
{
lock (m_textureSenders)
{
if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender))
{
textureSender.Cancel = true;
}
}
}
} }
protected void TextureReceived(string id, Object sender, AssetBase asset) protected void TextureReceived(string id, Object sender, AssetBase asset)
@ -189,6 +179,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
if (closed) if (closed)
return; return;
/*
lock (m_textureSenders) lock (m_textureSenders)
{ {
TextureSender.TextureSender textureSender; TextureSender.TextureSender textureSender;
@ -233,6 +224,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
textureID); textureID);
} }
} }
*/
} }
/// <summary> /// <summary>