diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 3a14b6f..4fe783d 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -290,9 +290,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
290 | { | 290 | { |
291 | foreach (PollServiceHttpRequest req in m_retryRequests) | 291 | foreach (PollServiceHttpRequest req in m_retryRequests) |
292 | { | 292 | { |
293 | m_server.DoHTTPGruntWork( | 293 | DoHTTPGruntWork(m_server,req, |
294 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), | 294 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
295 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); | ||
296 | } | 295 | } |
297 | } | 296 | } |
298 | catch | 297 | catch |
@@ -313,9 +312,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
313 | try | 312 | try |
314 | { | 313 | { |
315 | wreq = m_requests.Dequeue(0); | 314 | wreq = m_requests.Dequeue(0); |
316 | m_server.DoHTTPGruntWork( | 315 | DoHTTPGruntWork(m_server,wreq, |
317 | wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id), | 316 | wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); |
318 | new OSHttpResponse(new HttpResponse(wreq.HttpContext, wreq.Request), wreq.HttpContext)); | ||
319 | } | 317 | } |
320 | catch | 318 | catch |
321 | { | 319 | { |
@@ -359,8 +357,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
359 | try | 357 | try |
360 | { | 358 | { |
361 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); | 359 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); |
362 | m_server.DoHTTPGruntWork(responsedata, | 360 | DoHTTPGruntWork(m_server, req, responsedata); |
363 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); | ||
364 | } | 361 | } |
365 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | 362 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream |
366 | { | 363 | { |
@@ -375,8 +372,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
375 | // if ((Environment.TickCount - req.RequestTime) > m_timeout) | 372 | // if ((Environment.TickCount - req.RequestTime) > m_timeout) |
376 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 373 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
377 | { | 374 | { |
378 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), | 375 | DoHTTPGruntWork(m_server, req, |
379 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); | 376 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
380 | } | 377 | } |
381 | else | 378 | else |
382 | { | 379 | { |
@@ -391,6 +388,46 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
391 | } | 388 | } |
392 | } | 389 | } |
393 | } | 390 | } |
391 | |||
392 | // DoHTTPGruntWork changed, not sending response | ||
393 | // do the same work around as core | ||
394 | |||
395 | internal static void DoHTTPGruntWork(BaseHttpServer server, PollServiceHttpRequest req, Hashtable responsedata) | ||
396 | { | ||
397 | OSHttpResponse response | ||
398 | = new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext); | ||
399 | |||
400 | byte[] buffer = server.DoHTTPGruntWork(responsedata, response); | ||
401 | |||
402 | response.SendChunked = false; | ||
403 | response.ContentLength64 = buffer.Length; | ||
404 | response.ContentEncoding = Encoding.UTF8; | ||
405 | |||
406 | try | ||
407 | { | ||
408 | response.OutputStream.Write(buffer, 0, buffer.Length); | ||
409 | } | ||
410 | catch (Exception ex) | ||
411 | { | ||
412 | m_log.Warn(string.Format("[POLL SERVICE WORKER THREAD]: Error ", ex)); | ||
413 | } | ||
414 | finally | ||
415 | { | ||
416 | //response.OutputStream.Close(); | ||
417 | try | ||
418 | { | ||
419 | response.OutputStream.Flush(); | ||
420 | response.Send(); | ||
421 | |||
422 | //if (!response.KeepAlive && response.ReuseContext) | ||
423 | // response.FreeContext(); | ||
424 | } | ||
425 | catch (Exception e) | ||
426 | { | ||
427 | m_log.Warn(String.Format("[POLL SERVICE WORKER THREAD]: Error ", e)); | ||
428 | } | ||
429 | } | ||
430 | } | ||
394 | } | 431 | } |
395 | } | 432 | } |
396 | 433 | ||