From 7d58b73bbcef148cdcd57b9a2796331c6497c397 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Jun 2017 21:55:47 +0100 Subject: some changes on pollevent --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 13 +------------ .../Servers/HttpServer/PollServiceRequestManager.cs | 9 ++------- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index e59d475..ce4503c 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1935,20 +1935,13 @@ namespace OpenSim.Framework.Servers.HttpServer { response.ProtocolVersion = (string)responsedata["http_protocol_version"]; } -/* + if (responsedata.ContainsKey("keepalive")) { bool keepalive = (bool)responsedata["keepalive"]; response.KeepAlive = keepalive; } - if (responsedata.ContainsKey("reusecontext")) - response.ReuseContext = (bool) responsedata["reusecontext"]; -*/ - // disable this things - response.KeepAlive = false; - // response.ReuseContext = false; - // Cross-Origin Resource Sharing with simple requests if (responsedata.ContainsKey("access_control_allow_origin")) response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]); @@ -1961,11 +1954,8 @@ namespace OpenSim.Framework.Servers.HttpServer contentType = "text/html"; } - - // The client ignores anything but 200 here for web login, so ensure that this is 200 for that - response.StatusCode = responsecode; if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently) @@ -1975,7 +1965,6 @@ namespace OpenSim.Framework.Servers.HttpServer } response.AddHeader("Content-Type", contentType); - if (responsedata.ContainsKey("headers")) { Hashtable headerdata = (Hashtable)responsedata["headers"]; diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 415c264..cbdd781 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -271,22 +271,17 @@ namespace OpenSim.Framework.Servers.HttpServer if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) { - Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); - m_threadPool.QueueWorkItem(x => { try { + Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); req.DoHTTPGruntWork(m_server, responsedata); } catch (ObjectDisposedException) { } finally { - if(req.HttpContext.CanSend() && req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Poll - && (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) - ReQueueEvent(req); - else - byContextDequeue(req); + byContextDequeue(req); } return null; }, null); -- cgit v1.1