Add try/catch around EQ request processing

Fixes Mantis #4061
remotes/origin/0.6.7-post-fixes
Melanie 2009-08-26 14:46:10 +01:00
parent cf2d1b5c10
commit 8a9d168928
1 changed files with 27 additions and 16 deletions

View File

@ -59,6 +59,8 @@ using System.IO;
using System.Text; using System.Text;
using HttpServer; using HttpServer;
using OpenMetaverse; using OpenMetaverse;
using System.Reflection;
using log4net;
namespace OpenSim.Framework.Servers.HttpServer namespace OpenSim.Framework.Servers.HttpServer
{ {
@ -66,6 +68,10 @@ namespace OpenSim.Framework.Servers.HttpServer
public class PollServiceWorkerThread public class PollServiceWorkerThread
{ {
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
public event ReQueuePollServiceItem ReQueue; public event ReQueuePollServiceItem ReQueue;
private readonly BaseHttpServer m_server; private readonly BaseHttpServer m_server;
@ -92,6 +98,8 @@ namespace OpenSim.Framework.Servers.HttpServer
while (m_running) while (m_running)
{ {
PollServiceHttpRequest req = m_request.Dequeue(); PollServiceHttpRequest req = m_request.Dequeue();
try
{
if (req.PollServiceArgs.HasEvents(req.PollServiceArgs.Id)) if (req.PollServiceArgs.HasEvents(req.PollServiceArgs.Id))
{ {
StreamReader str = new StreamReader(req.Request.Body); StreamReader str = new StreamReader(req.Request.Body);
@ -115,8 +123,11 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
} }
catch (Exception e)
{
m_log.ErrorFormat("Exception in poll service thread: " + e.ToString());
}
}
} }
internal void Enqueue(PollServiceHttpRequest pPollServiceHttpRequest) internal void Enqueue(PollServiceHttpRequest pPollServiceHttpRequest)