From d38e2c0c91b684d54974865d3ac2fb88c3354c21 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Jan 2012 21:57:12 +0000 Subject: Add image not in database test for LLImageManager --- .../ClientStack/Linden/UDP/LLImageManager.cs | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs index 7bfb844..a48251f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs @@ -55,18 +55,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private bool m_shuttingdown; private AssetBase m_missingImage; - private IClientAPI m_client; //Client we're assigned to - private IAssetService m_assetCache; //Asset Cache - private IJ2KDecoder m_j2kDecodeModule; //Our J2K module + private IAssetService m_assetCache; + private IJ2KDecoder m_j2kDecodeModule; + + /// + /// Priority queue for determining which image to send first. + /// private C5.IntervalHeap m_priorityQueue = new C5.IntervalHeap(10, new J2KImageComparer()); + + /// + /// Used to control thread access to the priority queue. + /// private object m_syncRoot = new object(); - public IClientAPI Client { get { return m_client; } } + /// + /// Client served by this image manager + /// + public IClientAPI Client { get; private set; } + public AssetBase MissingImage { get { return m_missingImage; } } public LLImageManager(IClientAPI client, IAssetService pAssetCache, IJ2KDecoder pJ2kDecodeModule) { - m_client = client; + Client = client; m_assetCache = pAssetCache; if (pAssetCache != null) @@ -90,7 +101,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Do a linear search for this texture download lock (m_syncRoot) + { m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest); + } if (imgrequest != null) { @@ -178,8 +191,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP imgrequest = new J2KImage(this); imgrequest.J2KDecoder = m_j2kDecodeModule; imgrequest.AssetService = m_assetCache; - imgrequest.AgentID = m_client.AgentId; - imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface(); + imgrequest.AgentID = Client.AgentId; + imgrequest.InventoryAccessModule = Client.Scene.RequestModuleInterface(); imgrequest.DiscardLevel = newRequest.DiscardLevel; imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); imgrequest.Priority = newRequest.Priority; @@ -210,7 +223,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (image.IsDecoded) { int sent; - bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent); + bool imageDone = image.SendPackets(Client, packetsToSend - packetsSent, out sent); packetsSent += sent; // If the send is complete, destroy any knowledge of this transfer -- cgit v1.1 From ea72428c9d3fa27ab43bb3e0b2e297bf3b22861e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 19 Jan 2012 23:09:16 +0000 Subject: Allow a viewer UDP image request retry to trigger another asset fetch if an existing fetch hasn't responded before a timeout. This is to stop a high priority image/texture request from blocking the entire download queue if its asset fetch got dropped for some reason. --- OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs index a48251f..073c357 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs @@ -101,9 +101,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Do a linear search for this texture download lock (m_syncRoot) - { m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest); - } if (imgrequest != null) { @@ -124,8 +122,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP // "[LL IMAGE MANAGER]: Received duplicate of existing request for {0}, start packet {1} from {2}", // newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name); - //m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}", - // newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority); +// m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}", +// newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority); //Check the packet sequence to make sure this isn't older than //one we've already received -- cgit v1.1