mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
add error handling to dlna channel support
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Security;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using MediaBrowser.Dlna.Server;
|
||||
using MediaBrowser.Model.Logging;
|
||||
@@ -33,7 +32,14 @@ namespace MediaBrowser.Dlna.Service
|
||||
LogRequest(request);
|
||||
}
|
||||
|
||||
return ProcessControlRequestInternal(request);
|
||||
var response = ProcessControlRequestInternal(request);
|
||||
|
||||
if (Config.GetDlnaConfiguration().EnableDebugLogging)
|
||||
{
|
||||
LogResponse(response);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -113,5 +119,17 @@ namespace MediaBrowser.Dlna.Service
|
||||
|
||||
Logger.LogMultiline("Control request", LogSeverity.Debug, builder);
|
||||
}
|
||||
|
||||
private void LogResponse(ControlResponse response)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
|
||||
var headers = string.Join(", ", response.Headers.Select(i => string.Format("{0}={1}", i.Key, i.Value)).ToArray());
|
||||
builder.AppendFormat("Headers: {0}", headers);
|
||||
builder.AppendLine();
|
||||
builder.Append(response.Xml);
|
||||
|
||||
Logger.LogMultiline("Control response", LogSeverity.Debug, builder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user