diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-14 13:09:22 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-14 13:09:22 -0400 |
| commit | 30496c11687e24fb2a609bfecaedc03cbf8d460d (patch) | |
| tree | 473b5a52cdd398767814a1ce8f9946352c3ee87f /MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs | |
| parent | 7683fe878f43903746518f124ca44a4a8e5c41c8 (diff) | |
made dlna logging optional
Diffstat (limited to 'MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs')
| -rw-r--r-- | MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs index bb03caf8e9..7a4928e5ca 100644 --- a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs +++ b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs @@ -1,4 +1,5 @@ using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Configuration; using System; using System.IO; using System.Net; @@ -16,10 +17,12 @@ namespace MediaBrowser.Dlna.PlayTo private static readonly CookieContainer Container = new CookieContainer(); private readonly IHttpClient _httpClient; + private readonly IServerConfigurationManager _config; - public SsdpHttpClient(IHttpClient httpClient) + public SsdpHttpClient(IHttpClient httpClient, IServerConfigurationManager config) { _httpClient = httpClient; + _config = config; } public async Task<XDocument> SendCommandAsync(string baseUrl, DeviceService service, string command, string postData, string header = null) @@ -45,7 +48,8 @@ namespace MediaBrowser.Dlna.PlayTo var options = new HttpRequestOptions { Url = url.ToString(), - UserAgent = USERAGENT + UserAgent = USERAGENT, + LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging }; options.RequestHeaders["HOST"] = ip + ":" + port; @@ -83,7 +87,8 @@ namespace MediaBrowser.Dlna.PlayTo var options = new HttpRequestOptions { Url = url.ToString(), - UserAgent = USERAGENT + UserAgent = USERAGENT, + LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging }; options.RequestHeaders["FriendlyName.DLNA.ORG"] = FriendlyName; @@ -106,7 +111,8 @@ namespace MediaBrowser.Dlna.PlayTo var options = new HttpRequestOptions { Url = url.ToString(), - UserAgent = USERAGENT + UserAgent = USERAGENT, + LogRequest = _config.Configuration.DlnaOptions.EnablePlayToDebugLogging }; options.RequestHeaders["SOAPAction"] = soapAction; |
