From f54ddd88a2d615a7d577671cd38e66e60994451d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 14 Mar 2011 12:56:50 +0100 Subject: Up the timeout on slow requests to 3000 to stop console spam. Make sure request method and target are reported correctly and drop the txn id as it's empty 99% of the time. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 1d05b02..953ed85 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -378,6 +378,22 @@ namespace OpenSim.Framework.Servers.HttpServer /// public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) { + if (request.HttpMethod == String.Empty) // Can't handle empty requests, not wasting a thread + { + try + { + SendHTML500(response); + } + catch + { + } + + return; + } + + string requestMethod = request.HttpMethod; + string uriString = request.RawUrl; + string reqnum = "unknown"; int tickstart = Environment.TickCount; @@ -495,7 +511,7 @@ namespace OpenSim.Framework.Servers.HttpServer request.InputStream.Close(); - // HTTP IN support. The script engine taes it from here + // HTTP IN support. The script engine takes it from here // Nothing to worry about for us. // if (buffer == null) @@ -609,9 +625,9 @@ namespace OpenSim.Framework.Servers.HttpServer { m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e); } - catch (InvalidOperationException e) + catch (Exception e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); + m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString()); SendHTML500(response); } finally @@ -619,9 +635,9 @@ namespace OpenSim.Framework.Servers.HttpServer // Every month or so this will wrap and give bad numbers, not really a problem // since its just for reporting, 200ms limit can be adjusted int tickdiff = Environment.TickCount - tickstart; - if (tickdiff > 500) + if (tickdiff > 3000) m_log.InfoFormat( - "[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms", reqnum, request.RawUrl, tickdiff); + "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff); } } -- cgit v1.1