* Prevent texture sender thread termination from immediately crashing the sim
parent
9848dc77cc
commit
09dabb2aec
|
@ -39,8 +39,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
|
||||||
{
|
{
|
||||||
public class TextureDownloadModule : IRegionModule
|
public class TextureDownloadModule : IRegionModule
|
||||||
{
|
{
|
||||||
//private static readonly log4net.ILog m_log
|
private static readonly log4net.ILog m_log
|
||||||
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// There is one queue for all textures waiting to be sent, regardless of the requesting user.
|
/// There is one queue for all textures waiting to be sent, regardless of the requesting user.
|
||||||
|
@ -176,34 +176,44 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
|
||||||
{
|
{
|
||||||
ITextureSender sender = null;
|
ITextureSender sender = null;
|
||||||
|
|
||||||
while (true)
|
try
|
||||||
{
|
{
|
||||||
sender = m_queueSenders.Dequeue();
|
while (true)
|
||||||
|
|
||||||
if (sender.Cancel)
|
|
||||||
{
|
{
|
||||||
TextureSent(sender);
|
sender = m_queueSenders.Dequeue();
|
||||||
|
|
||||||
sender.Cancel = false;
|
if (sender.Cancel)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bool finished = sender.SendTexturePacket();
|
|
||||||
if (finished)
|
|
||||||
{
|
{
|
||||||
TextureSent(sender);
|
TextureSent(sender);
|
||||||
|
|
||||||
|
sender.Cancel = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_queueSenders.Enqueue(sender);
|
bool finished = sender.SendTexturePacket();
|
||||||
|
if (finished)
|
||||||
|
{
|
||||||
|
TextureSent(sender);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_queueSenders.Enqueue(sender);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure that any sender we currently have can get garbage collected
|
||||||
|
sender = null;
|
||||||
|
|
||||||
|
//m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that any sender we currently have can get garbage collected
|
|
||||||
sender = null;
|
|
||||||
|
|
||||||
//m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
|
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
|
||||||
|
e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -371,7 +371,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
|
|
||||||
public void Reconnect()
|
public void Reconnect()
|
||||||
{
|
{
|
||||||
|
|
||||||
m_log.DebugFormat("[IRC-Connector-{0}]: Reconnect request for {1} on {2}:{3}", idn, m_nick, m_server, m_ircChannel);
|
m_log.DebugFormat("[IRC-Connector-{0}]: Reconnect request for {1} on {2}:{3}", idn, m_nick, m_server, m_ircChannel);
|
||||||
|
|
||||||
// Don't do this if a Connect is in progress...
|
// Don't do this if a Connect is in progress...
|
||||||
|
@ -518,7 +517,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_enabled) Reconnect();
|
if (m_enabled) Reconnect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Regex RE = new Regex(@":(?<nick>[\w-]*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)",
|
private Regex RE = new Regex(@":(?<nick>[\w-]*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)",
|
||||||
|
|
Loading…
Reference in New Issue