mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
remove trailing whitespace
This commit is contained in:
@@ -23,10 +23,10 @@ namespace SocketHttpListener.Net
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
|
||||
@@ -177,9 +177,9 @@ namespace SocketHttpListener.Net
|
||||
}
|
||||
}
|
||||
|
||||
// This method is the callback method associated with Socket.AcceptAsync
|
||||
// operations and is invoked when an accept operation is complete
|
||||
//
|
||||
// This method is the callback method associated with Socket.AcceptAsync
|
||||
// operations and is invoked when an accept operation is complete
|
||||
//
|
||||
private static void OnAccept(object sender, SocketAsyncEventArgs e)
|
||||
{
|
||||
ProcessAccept(e);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace SocketHttpListener.Net
|
||||
bool listening;
|
||||
bool disposed;
|
||||
|
||||
Dictionary<HttpListenerContext, HttpListenerContext> registry; // Dictionary<HttpListenerContext,HttpListenerContext>
|
||||
Dictionary<HttpListenerContext, HttpListenerContext> registry; // Dictionary<HttpListenerContext,HttpListenerContext>
|
||||
Dictionary<HttpConnection, HttpConnection> connections;
|
||||
private ILogger _logger;
|
||||
private X509Certificate _certificate;
|
||||
|
||||
@@ -28,11 +28,11 @@ namespace SocketHttpListener.Net
|
||||
// The raw path is parsed by looping through all characters from left to right. 'rawOctets'
|
||||
// is used to store consecutive percent encoded octets as actual byte values: e.g. for path /pa%C3%84th%2F/
|
||||
// rawOctets will be set to { 0xC3, 0x84 } when we reach character 't' and it will be { 0x2F } when
|
||||
// we reach the final '/'. I.e. after a sequence of percent encoded octets ends, we use rawOctets as
|
||||
// we reach the final '/'. I.e. after a sequence of percent encoded octets ends, we use rawOctets as
|
||||
// input to the encoding and percent encode the resulting string into UTF-8 octets.
|
||||
//
|
||||
// When parsing ANSI (Latin 1) encoded path '/pa%C4th/', %C4 will be added to rawOctets and when
|
||||
// we reach 't', the content of rawOctets { 0xC4 } will be fed into the ANSI encoding. The resulting
|
||||
// we reach 't', the content of rawOctets { 0xC4 } will be fed into the ANSI encoding. The resulting
|
||||
// string 'Ä' will be percent encoded into UTF-8 octets and appended to requestUriString. The final
|
||||
// path will be '/pa%C3%84th/', where '%C3%84' is the UTF-8 percent encoded character 'Ä'.
|
||||
private List<byte> _rawOctets;
|
||||
@@ -146,7 +146,7 @@ namespace SocketHttpListener.Net
|
||||
|
||||
if (!Uri.TryCreate(_requestUriString.ToString(), UriKind.Absolute, out _requestUri))
|
||||
{
|
||||
// If we can't create a Uri from the string, this is an invalid string and it doesn't make
|
||||
// If we can't create a Uri from the string, this is an invalid string and it doesn't make
|
||||
// sense to try another encoding.
|
||||
result = ParsingResult.InvalidString;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ namespace SocketHttpListener.Net
|
||||
}
|
||||
else
|
||||
{
|
||||
// We found '%', but not followed by 'u', i.e. we have a percent encoded octed: %XX
|
||||
// We found '%', but not followed by 'u', i.e. we have a percent encoded octed: %XX
|
||||
if (!AddPercentEncodedOctetToRawOctetsList(encoding, _rawPath.Substring(index, 2)))
|
||||
{
|
||||
return ParsingResult.InvalidString;
|
||||
@@ -207,7 +207,7 @@ namespace SocketHttpListener.Net
|
||||
else
|
||||
{
|
||||
// We found a non-'%' character: decode the content of rawOctets into percent encoded
|
||||
// UTF-8 characters and append it to the result.
|
||||
// UTF-8 characters and append it to the result.
|
||||
if (!EmptyDecodeAndAppendRawOctetsList(encoding))
|
||||
{
|
||||
return ParsingResult.EncodingError;
|
||||
@@ -402,7 +402,7 @@ namespace SocketHttpListener.Net
|
||||
|
||||
// Find end of path: The path is terminated by
|
||||
// - the first '?' character
|
||||
// - the first '#' character: This is never the case here, since http.sys won't accept
|
||||
// - the first '#' character: This is never the case here, since http.sys won't accept
|
||||
// Uris containing fragments. Also, RFC2616 doesn't allow fragments in request Uris.
|
||||
// - end of Uri string
|
||||
int queryIndex = uriString.IndexOf('?');
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace SocketHttpListener.Net.WebSockets
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server.
|
||||
// return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server.
|
||||
internal static bool ProcessWebSocketProtocolHeader(string clientSecWebSocketProtocol,
|
||||
string subProtocol,
|
||||
out string acceptProtocol)
|
||||
@@ -44,7 +44,7 @@ namespace SocketHttpListener.Net.WebSockets
|
||||
// If the server specified _anything_ this isn't valid.
|
||||
throw new WebSocketException("UnsupportedProtocol");
|
||||
}
|
||||
// Treat empty and null from the server as the same thing here, server should not send headers.
|
||||
// Treat empty and null from the server as the same thing here, server should not send headers.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace SocketHttpListener.Net.WebSockets
|
||||
|
||||
if (subProtocol == null)
|
||||
{
|
||||
// client specified some protocols, server specified 'null'. So server should send headers.
|
||||
// client specified some protocols, server specified 'null'. So server should send headers.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace SocketHttpListener.Net.WebSockets
|
||||
StringSplitOptions.RemoveEmptyEntries);
|
||||
acceptProtocol = subProtocol;
|
||||
|
||||
// client specified protocols, serverOptions has exactly 1 non-empty entry. Check that
|
||||
// this exists in the list the client specified.
|
||||
// client specified protocols, serverOptions has exactly 1 non-empty entry. Check that
|
||||
// this exists in the list the client specified.
|
||||
for (int i = 0; i < requestProtocols.Length; i++)
|
||||
{
|
||||
string currentRequestProtocol = requestProtocols[i].Trim();
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace SocketHttpListener.Net.WebSockets
|
||||
// 0 - 999 Status codes in the range 0-999 are not used.
|
||||
// 1000 - 1999 Status codes in the range 1000-1999 are reserved for definition by this protocol.
|
||||
// 2000 - 2999 Status codes in the range 2000-2999 are reserved for use by extensions.
|
||||
// 3000 - 3999 Status codes in the range 3000-3999 MAY be used by libraries and frameworks. The
|
||||
// interpretation of these codes is undefined by this protocol. End applications MUST
|
||||
// NOT use status codes in this range.
|
||||
// 3000 - 3999 Status codes in the range 3000-3999 MAY be used by libraries and frameworks. The
|
||||
// interpretation of these codes is undefined by this protocol. End applications MUST
|
||||
// NOT use status codes in this range.
|
||||
// 4000 - 4999 Status codes in the range 4000-4999 MAY be used by application code. The interpretation
|
||||
// of these codes is undefined by this protocol.
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SocketHttpListener")]
|
||||
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@@ -25,10 +25,10 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
Reference in New Issue
Block a user