Browse Source

Single line comments should start with a space

Bond-009 6 years ago
parent
commit
ebae7229c1

+ 4 - 4
Jellyfin.Server/SocketSharp/RequestMono.cs

@@ -570,10 +570,10 @@ namespace Jellyfin.Server.SocketSharp
             public HttpMultipart(Stream data, string b, Encoding encoding)
             {
                 this.data = data;
-                //DB: 30/01/11: cannot set or read the Position in HttpListener in Win.NET
-                //var ms = new MemoryStream(32 * 1024);
-                //data.CopyTo(ms);
-                //this.data = ms;
+                // DB: 30/01/11: cannot set or read the Position in HttpListener in Win.NET
+                // var ms = new MemoryStream(32 * 1024);
+                // data.CopyTo(ms);
+                // this.data = ms;
 
                 boundary = b;
                 boundary_bytes = encoding.GetBytes(b);

+ 1 - 15
Jellyfin.Server/SocketSharp/SharpWebSocket.cs

@@ -55,7 +55,7 @@ namespace Jellyfin.Server.SocketSharp
         void socket_OnError(object sender, SocketHttpListener.ErrorEventArgs e)
         {
             _logger.LogError("Error in SharpWebSocket: {Message}", e.Message ?? string.Empty);
-            //Closed?.Invoke(this, EventArgs.Empty);
+            // Closed?.Invoke(this, EventArgs.Empty);
         }
 
         void socket_OnClose(object sender, SocketHttpListener.CloseEventArgs e)
@@ -67,14 +67,6 @@ namespace Jellyfin.Server.SocketSharp
 
         void socket_OnMessage(object sender, SocketHttpListener.MessageEventArgs e)
         {
-            //if (!string.IsNullOrEmpty(e.Data))
-            //{
-            //    if (OnReceive != null)
-            //    {
-            //        OnReceive(e.Data);
-            //    }
-            //    return;
-            //}
             if (OnReceiveBytes != null)
             {
                 OnReceiveBytes(e.RawData);
@@ -142,11 +134,5 @@ namespace Jellyfin.Server.SocketSharp
         /// </summary>
         /// <value>The receive action.</value>
         public Action<byte[]> OnReceiveBytes { get; set; }
-
-        /// <summary>
-        /// Gets or sets the on receive.
-        /// </summary>
-        /// <value>The on receive.</value>
-        public Action<string> OnReceive { get; set; }
     }
 }

+ 2 - 2
Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs

@@ -201,7 +201,7 @@ namespace Jellyfin.Server.SocketSharp
             }
             catch (ObjectDisposedException)
             {
-                //TODO Investigate and properly fix.
+                // TODO: Investigate and properly fix.
             }
             catch (Exception ex)
             {
@@ -252,7 +252,7 @@ namespace Jellyfin.Server.SocketSharp
                     Stop();
                 }
 
-                //release unmanaged resources here...
+                // release unmanaged resources here...
                 _disposed = true;
             }
         }

+ 1 - 1
Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs

@@ -24,7 +24,7 @@ namespace Jellyfin.Server.SocketSharp
             this.request = httpContext.Request;
             this.response = new WebSocketSharpResponse(logger, httpContext.Response, this);
 
-            //HandlerFactoryPath = GetHandlerPathIfAny(UrlPrefixes[0]);
+            // HandlerFactoryPath = GetHandlerPathIfAny(UrlPrefixes[0]);
         }
 
         private static string GetHandlerPathIfAny(string listenerUrl)

+ 4 - 8
Jellyfin.Server/SocketSharp/WebSocketSharpResponse.cs

@@ -51,7 +51,7 @@ namespace Jellyfin.Server.SocketSharp
             set => _response.ContentType = value;
         }
 
-        //public ICookies Cookies { get; set; }
+        // public ICookies Cookies { get; set; }
 
         public void AddHeader(string name, string value)
         {
@@ -114,9 +114,9 @@ namespace Jellyfin.Server.SocketSharp
 
         public void SetContentLength(long contentLength)
         {
-            //you can happily set the Content-Length header in Asp.Net
-            //but HttpListener will complain if you do - you have to set ContentLength64 on the response.
-            //workaround: HttpListener throws "The parameter is incorrect" exceptions when we try to set the Content-Length header
+            // you can happily set the Content-Length header in Asp.Net
+            // but HttpListener will complain if you do - you have to set ContentLength64 on the response.
+            // workaround: HttpListener throws "The parameter is incorrect" exceptions when we try to set the Content-Length header
             _response.ContentLength64 = contentLength;
         }
 
@@ -147,10 +147,6 @@ namespace Jellyfin.Server.SocketSharp
             {
                 sb.Append($";domain={cookie.Domain}");
             }
-            //else if (restrictAllCookiesToDomain != null)
-            //{
-            //    sb.Append($";domain={restrictAllCookiesToDomain}");
-            //}
 
             if (cookie.Secure)
             {