mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
http send is blocking, so we need we need to do it async in all cases. - this will need revision after server changes
This commit is contained in:
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
STPStartInfo startInfo = new STPStartInfo();
|
||||
startInfo.IdleTimeout = 30000;
|
||||
startInfo.MaxWorkerThreads = 15;
|
||||
startInfo.MaxWorkerThreads = 20;
|
||||
startInfo.MinWorkerThreads = 1;
|
||||
startInfo.ThreadPriority = ThreadPriority.Normal;
|
||||
startInfo.StartSuspended = true;
|
||||
@@ -160,7 +160,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void EnqueueInt(PollServiceHttpRequest req)
|
||||
{
|
||||
if (m_running)
|
||||
@@ -272,7 +271,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id);
|
||||
|
||||
if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) // This is the event queue
|
||||
m_threadPool.QueueWorkItem(x =>
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -283,32 +282,27 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
// Ignore it, no need to reply
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_threadPool.QueueWorkItem(x =>
|
||||
{
|
||||
try
|
||||
{
|
||||
req.DoHTTPGruntWork(m_server, responsedata);
|
||||
byContextDequeue(req);
|
||||
}
|
||||
catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
|
||||
{
|
||||
// Ignore it, no need to reply
|
||||
}
|
||||
|
||||
return null;
|
||||
}, null);
|
||||
}
|
||||
return null;
|
||||
}, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
|
||||
{
|
||||
req.DoHTTPGruntWork(m_server,
|
||||
req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
|
||||
byContextDequeue(req);
|
||||
m_threadPool.QueueWorkItem(x =>
|
||||
{
|
||||
try
|
||||
{
|
||||
req.DoHTTPGruntWork(m_server,
|
||||
req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
|
||||
byContextDequeue(req);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// Ignore it, no need to reply
|
||||
}
|
||||
return null;
|
||||
}, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user