From 552b85d33d4dc465d84fccb0c6e14c2f45213716 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 18 Jul 2013 12:25:04 -0700 Subject: Revert "Revert "Putting the requests back in the queue while testing for count >0 is not the smartest move..."" This reverts commit 71278919575b0e0222cdbe3c0cefa5919f9a75bc. --- .../Framework/Servers/HttpServer/PollServiceRequestManager.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/Servers/HttpServer') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 4cb551c..c50df5a 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -126,18 +126,22 @@ namespace OpenSim.Framework.Servers.HttpServer Thread.Sleep(1000); Watchdog.UpdateThread(); - PollServiceHttpRequest req; + List not_ready = new List(); lock (m_longPollRequests) { while (m_longPollRequests.Count > 0 && m_running) { - req = m_longPollRequests.Dequeue(); + PollServiceHttpRequest req = m_longPollRequests.Dequeue(); if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout m_requests.Enqueue(req); else - m_longPollRequests.Enqueue(req); + not_ready.Add(req); } + + foreach (PollServiceHttpRequest req in not_ready) + m_longPollRequests.Enqueue(req); + } } } -- cgit v1.1