aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 3343f60..86ad7aa 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -346,9 +346,15 @@ namespace OpenSim.Framework.Servers.HttpServer
346 /// <param name="response"></param> 346 /// <param name="response"></param>
347 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) 347 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
348 { 348 {
349 string reqnum = "unknown";
350 int tickstart = Environment.TickCount;
351
349 try 352 try
350 { 353 {
351 //m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); 354 // OpenSim.Framework.WebUtil.OSHeaderRequestID
355 if (request.Headers["opensim-request-id"] != null)
356 reqnum = String.Format("{0}:{1}",request.RemoteIPEndPoint,request.Headers["opensim-request-id"]);
357 // m_log.DebugFormat("[BASE HTTP SERVER]: <{0}> handle request for {1}",reqnum,request.RawUrl);
352 358
353 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); 359 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
354 360
@@ -576,6 +582,14 @@ namespace OpenSim.Framework.Servers.HttpServer
576 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); 582 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e);
577 SendHTML500(response); 583 SendHTML500(response);
578 } 584 }
585 finally
586 {
587 // Every month or so this will wrap and give bad numbers, not really a problem
588 // since its just for reporting, 200ms limit can be adjusted
589 int tickdiff = Environment.TickCount - tickstart;
590 if (tickdiff > 200)
591 m_log.InfoFormat("[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms",reqnum,request.RawUrl,tickdiff);
592 }
579 } 593 }
580 594
581 private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler) 595 private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)