aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs41
1 files changed, 17 insertions, 24 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index c13c65b..c234537 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -205,7 +205,7 @@ namespace OpenSim.Framework.Servers.HttpServer
205 String.Format("PollServiceWorkerThread{0}", i), 205 String.Format("PollServiceWorkerThread{0}", i),
206 ThreadPriority.Normal, 206 ThreadPriority.Normal,
207 false, 207 false,
208 true, 208 false,
209 null, 209 null,
210 int.MaxValue); 210 int.MaxValue);
211 } 211 }
@@ -344,35 +344,36 @@ namespace OpenSim.Framework.Servers.HttpServer
344 { 344 {
345 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) 345 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
346 { 346 {
347 try 347 string strreq = "";
348 if (req.PollServiceArgs.GetEventsNeedsRequest)
348 { 349 {
349 str = new StreamReader(req.Request.Body); 350 try
351 {
352 str = new StreamReader(req.Request.Body);
353 strreq = str.ReadToEnd();
354 str.Close();
355 }
356 catch
357 {
358 continue;
359 }
350 } 360 }
351 catch (System.ArgumentException) 361
352 { 362 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, strreq);
353 // Stream was not readable means a child agent 363
354 // was closed due to logout, leaving the 364 if (responsedata == null)
355 // Event Queue request orphaned.
356 continue; 365 continue;
357 }
358 366
359 // "Normal" means the viewer evebt queue. We need to push these out fast.
360 // Process them inline. The rest go to the thread pool.
361 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal) 367 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal)
362 { 368 {
363 try 369 try
364 { 370 {
365 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
366 DoHTTPGruntWork(m_server, req, responsedata); 371 DoHTTPGruntWork(m_server, req, responsedata);
367 } 372 }
368 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 373 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
369 { 374 {
370 // Ignore it, no need to reply 375 // Ignore it, no need to reply
371 } 376 }
372 finally
373 {
374 str.Close();
375 }
376 } 377 }
377 else 378 else
378 { 379 {
@@ -380,27 +381,19 @@ namespace OpenSim.Framework.Servers.HttpServer
380 { 381 {
381 try 382 try
382 { 383 {
383 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
384 DoHTTPGruntWork(m_server, req, responsedata); 384 DoHTTPGruntWork(m_server, req, responsedata);
385 } 385 }
386 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 386 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
387 { 387 {
388 // Ignore it, no need to reply 388 // Ignore it, no need to reply
389 } 389 }
390 finally
391 {
392 str.Close();
393 }
394 390
395 return null; 391 return null;
396 }, null); 392 }, null);
397 } 393 }
398
399 } 394 }
400 else 395 else
401 { 396 {
402// if ((Environment.TickCount - req.RequestTime) > m_timeout)
403
404 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) 397 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
405 { 398 {
406 DoHTTPGruntWork(m_server, req, 399 DoHTTPGruntWork(m_server, req,