Restore the missing image handling to the image manager. The missing

image packet crashes Hippo without a message.
prioritization
Melanie 2009-10-02 05:49:27 +01:00
parent 9a429610e2
commit 3ba36bb4d8
3 changed files with 104 additions and 83 deletions

View File

@ -235,7 +235,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (m_imageManager.Client.PacketHandler.GetQueueCount(ThrottleOutPacketType.Texture) == 0) if (m_imageManager.Client.PacketHandler.GetQueueCount(ThrottleOutPacketType.Texture) == 0)
{ {
m_log.Debug("No textures queued, sending one packet to kickstart it"); //m_log.Debug("No textures queued, sending one packet to kickstart it");
SendPacket(m_imageManager.Client); SendPacket(m_imageManager.Client);
} }
} }
@ -333,7 +333,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (Data == null) if (Data == null)
{ {
client.SendImageNotFound(m_requestedUUID); client.SendImageNotFound(m_requestedUUID);
m_log.WarnFormat("[TEXTURE]: Got null Data element on a asset {0}.. and the missing image Data property is al", m_requestedUUID); m_log.WarnFormat("[TEXTURE]: Got null Data element on a asset {0}.. and the missing image Data property is also null", m_requestedUUID);
return true; return true;
} }
// Do we have less then 1 packet's worth of data? // Do we have less then 1 packet's worth of data?
@ -373,10 +373,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_hasasset = true; m_hasasset = true;
if (asset == null || asset.Data == null) if (asset == null || asset.Data == null)
{
if (m_imageManager.MissingImage != null)
{
m_asset = m_imageManager.MissingImage;
m_assetDataLength = m_asset.Data.Length;
}
else
{ {
m_asset = null; m_asset = null;
m_decoded = true; m_decoded = true;
} }
}
else else
{ {
m_asset = asset; m_asset = asset;

View File

@ -141,7 +141,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected int m_primTerseUpdateRate = 10; protected int m_primTerseUpdateRate = 10;
protected int m_primFullUpdateRate = 14; protected int m_primFullUpdateRate = 14;
protected int m_textureSendLimit = 100; protected int m_textureSendLimit = 20;
protected int m_textureDataLimit = 10; protected int m_textureDataLimit = 10;
protected int m_packetMTU = 1400; protected int m_packetMTU = 1400;
@ -3139,7 +3139,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
switch (queue) switch (queue)
{ {
case ThrottleOutPacketType.Texture: case ThrottleOutPacketType.Texture:
m_log.Debug("Texture queue empty");
ProcessTextureRequests(); ProcessTextureRequests();
break; break;
} }

View File

@ -52,6 +52,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private bool m_shuttingdown = false; private bool m_shuttingdown = false;
private long m_lastloopprocessed = 0; private long m_lastloopprocessed = 0;
private AssetBase m_missingImage = null;
private LLClientView m_client; //Client we're assigned to private LLClientView m_client; //Client we're assigned to
private IAssetService m_assetCache; //Asset Cache private IAssetService m_assetCache; //Asset Cache
@ -62,6 +63,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
m_client = client; m_client = client;
m_assetCache = pAssetCache; m_assetCache = pAssetCache;
if (pAssetCache != null)
m_missingImage = pAssetCache.Get("5748decc-f629-461c-9a36-a35a221fe21f");
else
m_log.Error("[ClientView] - couldn't set missing image asset, falling back to missing image packet. This is known to crash the client");
m_j2kDecodeModule = pJ2kDecodeModule; m_j2kDecodeModule = pJ2kDecodeModule;
} }
@ -70,6 +76,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return m_client; } get { return m_client; }
} }
public AssetBase MissingImage
{
get { return m_missingImage; }
}
public void EnqueueReq(TextureRequestArgs newRequest) public void EnqueueReq(TextureRequestArgs newRequest)
{ {
//newRequest is the properties of our new texture fetch request. //newRequest is the properties of our new texture fetch request.
@ -182,6 +193,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
public bool ProcessImageQueue(int count, int maxpack) public bool ProcessImageQueue(int count, int maxpack)
{
lock (this)
{ {
//count is the number of textures we want to process in one go. //count is the number of textures we want to process in one go.
//As part of this class re-write, that number will probably rise //As part of this class re-write, that number will probably rise
@ -228,7 +241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//Uncomment this to see what the texture stack is doing //Uncomment this to see what the texture stack is doing
//m_log.Debug("Queue: " + m_client.PacketHandler.PacketQueue.getQueueCount(ThrottleOutPacketType.Texture).ToString() + " Threshold: " + threshold.ToString() + " outstanding: " + m_outstandingtextures.ToString()); //m_log.Debug("Queue: " + m_client.PacketHandler.PacketQueue.getQueueCount(ThrottleOutPacketType.Texture).ToString() + " Threshold: " + threshold.ToString() + " outstanding: " + m_outstandingtextures.ToString());
if (m_client.PacketHandler.PacketQueue.GetQueueCount(ThrottleOutPacketType.Texture) < threshold) if (true) //m_client.PacketHandler.PacketQueue.GetQueueCount(ThrottleOutPacketType.Texture) < threshold)
{ {
while (m_priorityQueue.Count > 0) while (m_priorityQueue.Count > 0)
{ {
@ -268,6 +281,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return m_priorityQueue.Count > 0; return m_priorityQueue.Count > 0;
} }
}
//Faux destructor //Faux destructor
public void Close() public void Close()