mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Single line comments should start with a space
This commit is contained in:
parent
3df8cda110
commit
ebae7229c1
@ -570,10 +570,10 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
public HttpMultipart(Stream data, string b, Encoding encoding)
|
public HttpMultipart(Stream data, string b, Encoding encoding)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
//DB: 30/01/11: cannot set or read the Position in HttpListener in Win.NET
|
// DB: 30/01/11: cannot set or read the Position in HttpListener in Win.NET
|
||||||
//var ms = new MemoryStream(32 * 1024);
|
// var ms = new MemoryStream(32 * 1024);
|
||||||
//data.CopyTo(ms);
|
// data.CopyTo(ms);
|
||||||
//this.data = ms;
|
// this.data = ms;
|
||||||
|
|
||||||
boundary = b;
|
boundary = b;
|
||||||
boundary_bytes = encoding.GetBytes(b);
|
boundary_bytes = encoding.GetBytes(b);
|
||||||
|
@ -55,7 +55,7 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
void socket_OnError(object sender, SocketHttpListener.ErrorEventArgs e)
|
void socket_OnError(object sender, SocketHttpListener.ErrorEventArgs e)
|
||||||
{
|
{
|
||||||
_logger.LogError("Error in SharpWebSocket: {Message}", e.Message ?? string.Empty);
|
_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)
|
void socket_OnClose(object sender, SocketHttpListener.CloseEventArgs e)
|
||||||
@ -67,14 +67,6 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
|
|
||||||
void socket_OnMessage(object sender, SocketHttpListener.MessageEventArgs e)
|
void socket_OnMessage(object sender, SocketHttpListener.MessageEventArgs e)
|
||||||
{
|
{
|
||||||
//if (!string.IsNullOrEmpty(e.Data))
|
|
||||||
//{
|
|
||||||
// if (OnReceive != null)
|
|
||||||
// {
|
|
||||||
// OnReceive(e.Data);
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
if (OnReceiveBytes != null)
|
if (OnReceiveBytes != null)
|
||||||
{
|
{
|
||||||
OnReceiveBytes(e.RawData);
|
OnReceiveBytes(e.RawData);
|
||||||
@ -142,11 +134,5 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The receive action.</value>
|
/// <value>The receive action.</value>
|
||||||
public Action<byte[]> OnReceiveBytes { get; set; }
|
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; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
catch (ObjectDisposedException)
|
||||||
{
|
{
|
||||||
//TODO Investigate and properly fix.
|
// TODO: Investigate and properly fix.
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
Stop();
|
Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
//release unmanaged resources here...
|
// release unmanaged resources here...
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
this.request = httpContext.Request;
|
this.request = httpContext.Request;
|
||||||
this.response = new WebSocketSharpResponse(logger, httpContext.Response, this);
|
this.response = new WebSocketSharpResponse(logger, httpContext.Response, this);
|
||||||
|
|
||||||
//HandlerFactoryPath = GetHandlerPathIfAny(UrlPrefixes[0]);
|
// HandlerFactoryPath = GetHandlerPathIfAny(UrlPrefixes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetHandlerPathIfAny(string listenerUrl)
|
private static string GetHandlerPathIfAny(string listenerUrl)
|
||||||
|
@ -51,7 +51,7 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
set => _response.ContentType = value;
|
set => _response.ContentType = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//public ICookies Cookies { get; set; }
|
// public ICookies Cookies { get; set; }
|
||||||
|
|
||||||
public void AddHeader(string name, string value)
|
public void AddHeader(string name, string value)
|
||||||
{
|
{
|
||||||
@ -114,9 +114,9 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
|
|
||||||
public void SetContentLength(long contentLength)
|
public void SetContentLength(long contentLength)
|
||||||
{
|
{
|
||||||
//you can happily set the Content-Length header in Asp.Net
|
// 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.
|
// 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
|
// workaround: HttpListener throws "The parameter is incorrect" exceptions when we try to set the Content-Length header
|
||||||
_response.ContentLength64 = contentLength;
|
_response.ContentLength64 = contentLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,10 +147,6 @@ namespace Jellyfin.Server.SocketSharp
|
|||||||
{
|
{
|
||||||
sb.Append($";domain={cookie.Domain}");
|
sb.Append($";domain={cookie.Domain}");
|
||||||
}
|
}
|
||||||
//else if (restrictAllCookiesToDomain != null)
|
|
||||||
//{
|
|
||||||
// sb.Append($";domain={restrictAllCookiesToDomain}");
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (cookie.Secure)
|
if (cookie.Secure)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user