소스 검색

update RespondToSearch

Luke Pulverenti 10 년 전
부모
커밋
cc160367c8
1개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 4
      MediaBrowser.Dlna/Ssdp/SsdpHandler.cs

+ 10 - 4
MediaBrowser.Dlna/Ssdp/SsdpHandler.cs

@@ -216,10 +216,7 @@ namespace MediaBrowser.Dlna.Ssdp
         {
             var enableDebugLogging = _config.GetDlnaConfiguration().EnableDebugLogging;
 
-            if (enableDebugLogging)
-            {
-                _logger.Debug("RespondToSearch");
-            }
+            var isLogged = false;
 
             const string header = "HTTP/1.1 200 OK";
 
@@ -228,6 +225,15 @@ namespace MediaBrowser.Dlna.Ssdp
                 if (string.Equals(deviceType, "ssdp:all", StringComparison.OrdinalIgnoreCase) ||
                     string.Equals(deviceType, d.Type, StringComparison.OrdinalIgnoreCase))
                 {
+                    if (!isLogged)
+                    {
+                        if (enableDebugLogging)
+                        {
+                            _logger.Debug("Responding to search from {0} for {1}", endpoint, deviceType);
+                        }
+                        isLogged = true;
+                    }
+
                     var values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
 
                     values["CACHE-CONTROL"] = "max-age = 600";