Merge branch 'ubitworkmaster'
commit
72dba594af
|
@ -115,6 +115,28 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void DoHTTPstop(BaseHttpServer server)
|
||||||
|
{
|
||||||
|
OSHttpResponse response
|
||||||
|
= new OSHttpResponse(new HttpResponse(HttpContext, Request), HttpContext);
|
||||||
|
|
||||||
|
response.SendChunked = false;
|
||||||
|
response.ContentLength64 = 0;
|
||||||
|
response.ContentEncoding = Encoding.UTF8;
|
||||||
|
response.ReuseContext = false;
|
||||||
|
response.KeepAlive = false;
|
||||||
|
response.SendChunked = false;
|
||||||
|
response.StatusCode = 503;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.OutputStream.Flush();
|
||||||
|
response.Send();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PollServiceHttpRequestComparer : IEqualityComparer<PollServiceHttpRequest>
|
class PollServiceHttpRequestComparer : IEqualityComparer<PollServiceHttpRequest>
|
||||||
|
|
|
@ -204,12 +204,17 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
foreach (Thread t in m_workerThreads)
|
foreach (Thread t in m_workerThreads)
|
||||||
Watchdog.AbortThread(t.ManagedThreadId);
|
Watchdog.AbortThread(t.ManagedThreadId);
|
||||||
|
|
||||||
|
// any entry in m_bycontext should have a active request on the other queues
|
||||||
|
// so just delete contents to easy GC
|
||||||
|
foreach (Queue<PollServiceHttpRequest> qu in m_bycontext.Values)
|
||||||
|
qu.Clear();
|
||||||
|
m_bycontext.Clear();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (PollServiceHttpRequest req in m_retryRequests)
|
foreach (PollServiceHttpRequest req in m_retryRequests)
|
||||||
{
|
{
|
||||||
req.DoHTTPGruntWork(m_server,
|
req.DoHTTPstop(m_server);
|
||||||
req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
@ -221,7 +226,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
lock (m_slowRequests)
|
lock (m_slowRequests)
|
||||||
{
|
{
|
||||||
while (m_slowRequests.Count > 0 && m_running)
|
while (m_slowRequests.Count > 0)
|
||||||
m_requests.Enqueue(m_slowRequests.Dequeue());
|
m_requests.Enqueue(m_slowRequests.Dequeue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,8 +235,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wreq = m_requests.Dequeue(0);
|
wreq = m_requests.Dequeue(0);
|
||||||
wreq.DoHTTPGruntWork(m_server,
|
wreq.DoHTTPstop(m_server);
|
||||||
wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id));
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue