diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 3f43149..db445fa 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -225,13 +225,16 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
225 | 225 | ||
226 | private void PoolWorkerJob() | 226 | private void PoolWorkerJob() |
227 | { | 227 | { |
228 | PollServiceHttpRequest req; | ||
228 | while (m_running) | 229 | while (m_running) |
229 | { | 230 | { |
230 | PollServiceHttpRequest req; | 231 | if(!m_requests.TryTake(out req, 4500) || req == null) |
231 | m_requests.TryTake(out req, 4500); | 232 | { |
232 | Watchdog.UpdateThread(); | 233 | Watchdog.UpdateThread(); |
233 | if(req == null) | ||
234 | continue; | 234 | continue; |
235 | } | ||
236 | |||
237 | Watchdog.UpdateThread(); | ||
235 | 238 | ||
236 | try | 239 | try |
237 | { | 240 | { |
@@ -256,17 +259,18 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
256 | 259 | ||
257 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) | 260 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) |
258 | { | 261 | { |
262 | PollServiceHttpRequest nreq = req; | ||
259 | m_threadPool.QueueWorkItem(x => | 263 | m_threadPool.QueueWorkItem(x => |
260 | { | 264 | { |
261 | try | 265 | try |
262 | { | 266 | { |
263 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); | 267 | Hashtable responsedata = nreq.PollServiceArgs.GetEvents(nreq.RequestID, nreq.PollServiceArgs.Id); |
264 | req.DoHTTPGruntWork(m_server, responsedata); | 268 | nreq.DoHTTPGruntWork(m_server, responsedata); |
265 | } | 269 | } |
266 | catch (ObjectDisposedException) { } | 270 | catch (ObjectDisposedException) { } |
267 | finally | 271 | finally |
268 | { | 272 | { |
269 | byContextDequeue(req); | 273 | byContextDequeue(nreq); |
270 | } | 274 | } |
271 | return null; | 275 | return null; |
272 | }, null); | 276 | }, null); |
@@ -275,17 +279,18 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
275 | { | 279 | { |
276 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 280 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
277 | { | 281 | { |
282 | PollServiceHttpRequest nreq = req; | ||
278 | m_threadPool.QueueWorkItem(x => | 283 | m_threadPool.QueueWorkItem(x => |
279 | { | 284 | { |
280 | try | 285 | try |
281 | { | 286 | { |
282 | req.DoHTTPGruntWork(m_server, | 287 | nreq.DoHTTPGruntWork(m_server, |
283 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 288 | nreq.PollServiceArgs.NoEvents(nreq.RequestID, nreq.PollServiceArgs.Id)); |
284 | } | 289 | } |
285 | catch (ObjectDisposedException) {} | 290 | catch (ObjectDisposedException) {} |
286 | finally | 291 | finally |
287 | { | 292 | { |
288 | byContextDequeue(req); | 293 | byContextDequeue(nreq); |
289 | } | 294 | } |
290 | return null; | 295 | return null; |
291 | }, null); | 296 | }, null); |