From d4adc9799c54b46c99a02cc2e74e62ea20f809e3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 22 Jan 2014 17:38:48 -0500 Subject: reduce size of logging messages --- .../HttpServer/HttpListenerHost.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs') diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 54fb345eb..b4c442ec8 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -253,13 +253,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer { try { - LogHttpRequest(context, index); - var request = context.Request; + LogHttpRequest(request, index); + if (request.IsWebSocketRequest) { - ProcessWebSocketRequest(context); + await ProcessWebSocketRequest(context).ConfigureAwait(false); return; } @@ -299,7 +299,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer if (EnableHttpRequestLogging) { - LoggerUtils.LogResponse(_logger, context, url, endPoint, duration); + LoggerUtils.LogResponse(_logger, context.Response, url, endPoint, duration); } } catch (Exception ex) @@ -315,10 +315,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer /// /// Logs the HTTP request. /// - /// The CTX. - private void LogHttpRequest(HttpListenerContext ctx, int index) + /// The request. + /// The index. + private void LogHttpRequest(HttpListenerRequest request, int index) { - var endpoint = ctx.Request.LocalEndPoint; + var endpoint = request.LocalEndPoint; if (endpoint != null) { @@ -329,7 +330,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer if (EnableHttpRequestLogging) { - LoggerUtils.LogRequest(_logger, ctx, index); + LoggerUtils.LogRequest(_logger, request, index); } } -- cgit v1.2.3