From 9ec672c70b28b8c1d6d81bab7744fcf7bf9b83c7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 24 Oct 2011 23:16:03 +0100 Subject: Fix bugs in EventQueueGetModule.ClientClosed() and BaseHttpServer.RemovePollServerHTTPHandler() that stopped existing code in ClientClosed() from actually tearing down the poll handler Actually doing the tear down appear to have no ill effects with region crossing and teleport. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 4 ++-- .../Framework/Servers/HttpServer/PollServiceRequestManager.cs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index fefa242..7ec813f 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1815,9 +1815,9 @@ namespace OpenSim.Framework.Servers.HttpServer { lock (m_pollHandlers) { - if (m_pollHandlers.ContainsKey(httpMethod)) + if (m_pollHandlers.ContainsKey(path)) { - m_pollHandlers.Remove(httpMethod); + m_pollHandlers.Remove(path); } } diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index e7a64f7..0840a9d 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -28,12 +28,16 @@ using System; using System.Collections; using System.Threading; +using System.Reflection; +using log4net; using HttpServer; namespace OpenSim.Framework.Servers.HttpServer { public class PollServiceRequestManager { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private readonly BaseHttpServer m_server; private static Queue m_requests = Queue.Synchronized(new Queue()); private uint m_WorkerThreadCount = 0; @@ -42,8 +46,6 @@ namespace OpenSim.Framework.Servers.HttpServer private Thread m_watcherThread; private bool m_running = true; - - public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) { m_server = pSrv; @@ -61,7 +63,6 @@ namespace OpenSim.Framework.Servers.HttpServer m_workerThreads[i].Name = String.Format("PollServiceWorkerThread{0}",i); //Can't add to thread Tracker here Referencing OpenSim.Framework creates circular reference m_workerThreads[i].Start(); - } //start watcher threads @@ -98,7 +99,10 @@ namespace OpenSim.Framework.Servers.HttpServer if (m_requests.Count == 0) return; +// m_log.DebugFormat("[POLL SERVICE REQUEST MANAGER]: Processing {0} requests", m_requests.Count); + int reqperthread = (int) (m_requests.Count/m_WorkerThreadCount) + 1; + // For Each WorkerThread for (int tc = 0; tc < m_WorkerThreadCount && m_requests.Count > 0; tc++) { -- cgit v1.1