aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2013-07-18 12:25:04 -0700
committerDiva Canto2013-07-18 12:25:04 -0700
commit552b85d33d4dc465d84fccb0c6e14c2f45213716 (patch)
tree203231f72aec425e100bc0d6b65c46dcae8d9bf2 /OpenSim
parentRevert "Revert "Didn't mean to commit this change in BlockingQueue.cs"" (diff)
downloadopensim-SC_OLD-552b85d33d4dc465d84fccb0c6e14c2f45213716.zip
opensim-SC_OLD-552b85d33d4dc465d84fccb0c6e14c2f45213716.tar.gz
opensim-SC_OLD-552b85d33d4dc465d84fccb0c6e14c2f45213716.tar.bz2
opensim-SC_OLD-552b85d33d4dc465d84fccb0c6e14c2f45213716.tar.xz
Revert "Revert "Putting the requests back in the queue while testing for count >0 is not the smartest move...""
This reverts commit 71278919575b0e0222cdbe3c0cefa5919f9a75bc.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs10
1 files changed, 7 insertions, 3 deletions
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
126 Thread.Sleep(1000); 126 Thread.Sleep(1000);
127 Watchdog.UpdateThread(); 127 Watchdog.UpdateThread();
128 128
129 PollServiceHttpRequest req; 129 List<PollServiceHttpRequest> not_ready = new List<PollServiceHttpRequest>();
130 lock (m_longPollRequests) 130 lock (m_longPollRequests)
131 { 131 {
132 while (m_longPollRequests.Count > 0 && m_running) 132 while (m_longPollRequests.Count > 0 && m_running)
133 { 133 {
134 req = m_longPollRequests.Dequeue(); 134 PollServiceHttpRequest req = m_longPollRequests.Dequeue();
135 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ 135 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ
136 (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout 136 (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout
137 m_requests.Enqueue(req); 137 m_requests.Enqueue(req);
138 else 138 else
139 m_longPollRequests.Enqueue(req); 139 not_ready.Add(req);
140 } 140 }
141
142 foreach (PollServiceHttpRequest req in not_ready)
143 m_longPollRequests.Enqueue(req);
144
141 } 145 }
142 } 146 }
143 } 147 }