From a2c245607610bacdacae065ec01c854fedd9df36 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 21 May 2017 02:11:53 +0100 Subject: remove LongPoll type and queues. Events should now have reduced latency also. About previus commit, it maybe a modified ingen-e3s-v1.33 script that is broken, and not the original version, can't tell --- .../Servers/HttpServer/PollServiceEventArgs.cs | 4 +-- .../HttpServer/PollServiceRequestManager.cs | 34 +--------------------- 2 files changed, 3 insertions(+), 35 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 8ace7a9..7150aad 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework.Servers.HttpServer public enum EventType : int { - LongPoll = 0, + Poll = 0, LslHttp = 1, Inventory = 2, Texture = 3, @@ -82,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer NoEvents = pNoEvents; Id = pId; TimeOutms = pTimeOutms; - Type = EventType.LongPoll; + Type = EventType.Poll; } } } diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 936146d..314719c 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -48,7 +48,6 @@ namespace OpenSim.Framework.Servers.HttpServer private Dictionary> m_bycontext; private BlockingQueue m_requests = new BlockingQueue(); - private static Queue m_slowRequests = new Queue(); private static Queue m_retryRequests = new Queue(); private uint m_WorkerThreadCount = 0; @@ -56,11 +55,9 @@ namespace OpenSim.Framework.Servers.HttpServer private Thread m_retrysThread; private bool m_running = false; - private int slowCount = 0; private SmartThreadPool m_threadPool; - public PollServiceRequestManager( BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout) { @@ -80,7 +77,6 @@ namespace OpenSim.Framework.Servers.HttpServer startInfo.ThreadPoolName = "PoolService"; m_threadPool = new SmartThreadPool(startInfo); - } public void Start() @@ -163,17 +159,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void EnqueueInt(PollServiceHttpRequest req) { if (m_running) - { - if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.LongPoll) - { - m_requests.Enqueue(req); - } - else - { - lock (m_slowRequests) - m_slowRequests.Enqueue(req); - } - } + m_requests.Enqueue(req); } private void CheckRetries() @@ -188,17 +174,6 @@ namespace OpenSim.Framework.Servers.HttpServer while (m_retryRequests.Count > 0 && m_running) m_requests.Enqueue(m_retryRequests.Dequeue()); } - slowCount++; - if (slowCount >= 10) - { - slowCount = 0; - - lock (m_slowRequests) - { - while (m_slowRequests.Count > 0 && m_running) - m_requests.Enqueue(m_slowRequests.Dequeue()); - } - } } } @@ -231,13 +206,6 @@ namespace OpenSim.Framework.Servers.HttpServer PollServiceHttpRequest wreq; m_retryRequests.Clear(); - lock (m_slowRequests) - { - while (m_slowRequests.Count > 0) - m_requests.Enqueue(m_slowRequests.Dequeue()); - - } - while (m_requests.Count() > 0) { try -- cgit v1.1