diff options
author | UbitUmarov | 2016-07-16 20:23:02 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-16 20:23:30 +0100 |
commit | f636ef037aa7bc7754ddb56d121e32e7823c8e73 (patch) | |
tree | 79fb9a226c7f8f81288d822e33bc62060b7aa454 /OpenSim/Framework/Servers | |
parent | simplify http textures and meshs Throttles (diff) | |
download | opensim-SC-f636ef037aa7bc7754ddb56d121e32e7823c8e73.zip opensim-SC-f636ef037aa7bc7754ddb56d121e32e7823c8e73.tar.gz opensim-SC-f636ef037aa7bc7754ddb56d121e32e7823c8e73.tar.bz2 opensim-SC-f636ef037aa7bc7754ddb56d121e32e7823c8e73.tar.xz |
http send is blocking, so we need we need to do it async in all cases. - this will need revision after server changes
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 30 |
2 files changed, 15 insertions, 20 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 20bdf17..1ac5059 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -461,7 +461,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
461 | } | 461 | } |
462 | 462 | ||
463 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); | 463 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); |
464 | resp.ReuseContext = true; | 464 | // resp.ReuseContext = true; |
465 | resp.ReuseContext = false; | ||
465 | HandleRequest(req, resp); | 466 | HandleRequest(req, resp); |
466 | 467 | ||
467 | // !!!HACK ALERT!!! | 468 | // !!!HACK ALERT!!! |
@@ -1954,7 +1955,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1954 | 1955 | ||
1955 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events | 1956 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events |
1956 | 1957 | ||
1957 | PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 3, 25000); | 1958 | PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 2, 25000); |
1958 | PollServiceRequestManager.Start(); | 1959 | PollServiceRequestManager.Start(); |
1959 | 1960 | ||
1960 | HTTPDRunning = true; | 1961 | HTTPDRunning = true; |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 0e4323a..ffcad0f 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
73 | 73 | ||
74 | STPStartInfo startInfo = new STPStartInfo(); | 74 | STPStartInfo startInfo = new STPStartInfo(); |
75 | startInfo.IdleTimeout = 30000; | 75 | startInfo.IdleTimeout = 30000; |
76 | startInfo.MaxWorkerThreads = 15; | 76 | startInfo.MaxWorkerThreads = 20; |
77 | startInfo.MinWorkerThreads = 1; | 77 | startInfo.MinWorkerThreads = 1; |
78 | startInfo.ThreadPriority = ThreadPriority.Normal; | 78 | startInfo.ThreadPriority = ThreadPriority.Normal; |
79 | startInfo.StartSuspended = true; | 79 | startInfo.StartSuspended = true; |
@@ -160,7 +160,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | |||
164 | public void EnqueueInt(PollServiceHttpRequest req) | 163 | public void EnqueueInt(PollServiceHttpRequest req) |
165 | { | 164 | { |
166 | if (m_running) | 165 | if (m_running) |
@@ -272,7 +271,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
272 | { | 271 | { |
273 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); | 272 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); |
274 | 273 | ||
275 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) // This is the event queue | 274 | m_threadPool.QueueWorkItem(x => |
276 | { | 275 | { |
277 | try | 276 | try |
278 | { | 277 | { |
@@ -283,33 +282,28 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
283 | { | 282 | { |
284 | // Ignore it, no need to reply | 283 | // Ignore it, no need to reply |
285 | } | 284 | } |
286 | } | 285 | return null; |
287 | else | 286 | }, null); |
287 | } | ||
288 | else | ||
289 | { | ||
290 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | ||
288 | { | 291 | { |
289 | m_threadPool.QueueWorkItem(x => | 292 | m_threadPool.QueueWorkItem(x => |
290 | { | 293 | { |
291 | try | 294 | try |
292 | { | 295 | { |
293 | req.DoHTTPGruntWork(m_server, responsedata); | 296 | req.DoHTTPGruntWork(m_server, |
297 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | ||
294 | byContextDequeue(req); | 298 | byContextDequeue(req); |
295 | } | 299 | } |
296 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | 300 | catch (ObjectDisposedException) |
297 | { | 301 | { |
298 | // Ignore it, no need to reply | 302 | // Ignore it, no need to reply |
299 | } | 303 | } |
300 | |||
301 | return null; | 304 | return null; |
302 | }, null); | 305 | }, null); |
303 | } | 306 | } |
304 | } | ||
305 | else | ||
306 | { | ||
307 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | ||
308 | { | ||
309 | req.DoHTTPGruntWork(m_server, | ||
310 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | ||
311 | byContextDequeue(req); | ||
312 | } | ||
313 | else | 307 | else |
314 | { | 308 | { |
315 | ReQueueEvent(req); | 309 | ReQueueEvent(req); |