소스 검색

Make SonarCloud happy

Bond_009 5 년 전
부모
커밋
3623aafcb6

+ 1 - 4
Emby.Server.Implementations/ApplicationHost.cs

@@ -93,7 +93,6 @@ using MediaBrowser.Model.Serialization;
 using MediaBrowser.Model.Services;
 using MediaBrowser.Model.System;
 using MediaBrowser.Model.Tasks;
-using MediaBrowser.Model.Updates;
 using MediaBrowser.Providers.Chapters;
 using MediaBrowser.Providers.Manager;
 using MediaBrowser.Providers.Plugins.TheTvdb;
@@ -101,12 +100,10 @@ using MediaBrowser.Providers.Subtitles;
 using MediaBrowser.WebDashboard.Api;
 using MediaBrowser.XbmcMetadata.Providers;
 using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Http.Extensions;
-using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
-using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
 using Prometheus.DotNetRuntime;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
 
 namespace Emby.Server.Implementations
 {

+ 1 - 24
Emby.Server.Implementations/HttpServer/HttpListenerHost.cs

@@ -28,12 +28,11 @@ using Microsoft.AspNetCore.WebUtilities;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
-using Microsoft.Net.Http.Headers;
 using ServiceStack.Text.Jsv;
 
 namespace Emby.Server.Implementations.HttpServer
 {
-    public class HttpListenerHost : IHttpServer, IDisposable
+    public class HttpListenerHost : IHttpServer
     {
         /// <summary>
         /// The key for a setting that specifies the default redirect path
@@ -699,28 +698,6 @@ namespace Emby.Server.Implementations.HttpServer
             return _baseUrlPrefix + NormalizeUrlPath(path);
         }
 
-        /// <inheritdoc />
-        public void Dispose()
-        {
-            Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-
-        protected virtual void Dispose(bool disposing)
-        {
-            if (_disposed)
-            {
-                return;
-            }
-
-            if (disposing)
-            {
-                // TODO:
-            }
-
-            _disposed = true;
-        }
-
         /// <summary>
         /// Processes the web socket message received.
         /// </summary>

+ 0 - 8
Emby.Server.Implementations/HttpServer/WebSocketConnection.cs

@@ -36,8 +36,6 @@ namespace Emby.Server.Implementations.HttpServer
         /// </summary>
         private readonly WebSocket _socket;
 
-        private bool _disposed = false;
-
         /// <summary>
         /// Initializes a new instance of the <see cref="WebSocketConnection" /> class.
         /// </summary>
@@ -221,12 +219,6 @@ namespace Emby.Server.Implementations.HttpServer
             };
 
             await OnReceive(info).ConfigureAwait(false);
-
-            // Stop reading if there's no more data coming
-            if (result.IsCompleted)
-            {
-                return;
-            }
         }
     }
 }

+ 1 - 1
Emby.Server.Implementations/Session/WebSocketController.cs

@@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Session
         private readonly ISessionManager _sessionManager;
         private readonly SessionInfo _session;
 
-        private List<IWebSocketConnection> _sockets;
+        private readonly List<IWebSocketConnection> _sockets;
         private bool _disposed = false;
 
         public WebSocketController(

+ 2 - 3
MediaBrowser.Controller/Net/IHttpServer.cs

@@ -2,15 +2,14 @@ using System;
 using System.Collections.Generic;
 using System.Threading.Tasks;
 using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Services;
 using Microsoft.AspNetCore.Http;
 
 namespace MediaBrowser.Controller.Net
 {
     /// <summary>
-    /// Interface IHttpServer
+    /// Interface IHttpServer.
     /// </summary>
-    public interface IHttpServer : IDisposable
+    public interface IHttpServer
     {
         /// <summary>
         /// Gets the URL prefix.