Merge branch 'master' into websocket

This commit is contained in:
Bond_009
2020-05-02 00:54:04 +02:00
1246 changed files with 23673 additions and 14062 deletions

View File

@@ -1,3 +1,5 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Net
{
public class EndPointInfo

View File

@@ -4,7 +4,7 @@ using System.Net;
namespace MediaBrowser.Model.Net
{
/// <summary>
/// Class HttpException
/// Class HttpException.
/// </summary>
public class HttpException : Exception
{

View File

@@ -1,3 +1,5 @@
#pragma warning disable CS1591
using System;
using System.Net;
using System.Threading;
@@ -14,8 +16,6 @@ namespace MediaBrowser.Model.Net
Task<SocketReceiveResult> ReceiveAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken);
int Receive(byte[] buffer, int offset, int count);
IAsyncResult BeginReceive(byte[] buffer, int offset, int count, AsyncCallback callback);
SocketReceiveResult EndReceive(IAsyncResult result);

View File

@@ -1,4 +1,5 @@
using System.IO;
#pragma warning disable CS1591
using System.Net;
namespace MediaBrowser.Model.Net
@@ -8,13 +9,6 @@ namespace MediaBrowser.Model.Net
/// </summary>
public interface ISocketFactory
{
/// <summary>
/// Creates a new unicast socket using the specified local port number.
/// </summary>
/// <param name="localPort">The local port to bind to.</param>
/// <returns>A <see cref="ISocket"/> implementation.</returns>
ISocket CreateUdpSocket(int localPort);
ISocket CreateUdpBroadcastSocket(int localPort);
/// <summary>
@@ -30,7 +24,5 @@ namespace MediaBrowser.Model.Net
/// <param name="localPort">The local port to bind to.</param>
/// <returns>A <see cref="ISocket"/> implementation.</returns>
ISocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort);
Stream CreateNetworkStream(ISocket socket, bool ownsSocket);
}
}

View File

@@ -1,8 +1,9 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Net
{
@@ -63,6 +64,7 @@ namespace MediaBrowser.Model.Net
{ ".m3u8", "application/x-mpegURL" },
{ ".mobi", "application/x-mobipocket-ebook" },
{ ".xml", "application/xml" },
{ ".wasm", "application/wasm" },
// Type image
{ ".jpg", "image/jpeg" },
@@ -104,6 +106,7 @@ namespace MediaBrowser.Model.Net
{ ".3g2", "video/3gpp2" },
{ ".mpd", "video/vnd.mpeg.dash.mpd" },
{ ".ts", "video/mp2t" },
{ ".mpegts", "video/mp2t" },
// Type audio
{ ".mp3", "audio/mpeg" },
@@ -121,6 +124,8 @@ namespace MediaBrowser.Model.Net
{ ".xsp", "audio/xsp" },
{ ".dsp", "audio/dsp" },
{ ".flac", "audio/flac" },
{ ".ape", "audio/x-ape" },
{ ".wv", "audio/x-wavpack" },
};
private static readonly Dictionary<string, string> _extensionLookup = CreateExtensionLookup();
@@ -165,20 +170,20 @@ namespace MediaBrowser.Model.Net
}
// Type text
if (StringHelper.EqualsIgnoreCase(ext, ".html")
|| StringHelper.EqualsIgnoreCase(ext, ".htm"))
if (string.Equals(ext, ".html", StringComparison.OrdinalIgnoreCase)
|| string.Equals(ext, ".htm", StringComparison.OrdinalIgnoreCase))
{
return "text/html; charset=UTF-8";
}
if (StringHelper.EqualsIgnoreCase(ext, ".log")
|| StringHelper.EqualsIgnoreCase(ext, ".srt"))
if (string.Equals(ext, ".log", StringComparison.OrdinalIgnoreCase)
|| string.Equals(ext, ".srt", StringComparison.OrdinalIgnoreCase))
{
return "text/plain";
}
// Misc
if (StringHelper.EqualsIgnoreCase(ext, ".dll"))
if (string.Equals(ext, ".dll", StringComparison.OrdinalIgnoreCase))
{
return "application/octet-stream";
}

View File

@@ -1,3 +1,5 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Net
{
public class NetworkShare

View File

@@ -1,28 +1,32 @@
namespace MediaBrowser.Model.Net
{
/// <summary>
/// Enum NetworkShareType
/// Enum NetworkShareType.
/// </summary>
public enum NetworkShareType
{
/// <summary>
/// Disk share
/// Disk share.
/// </summary>
Disk,
/// <summary>
/// Printer share
/// Printer share.
/// </summary>
Printer,
/// <summary>
/// Device share
/// Device share.
/// </summary>
Device,
/// <summary>
/// IPC share
/// IPC share.
/// </summary>
Ipc,
/// <summary>
/// Special share
/// Special share.
/// </summary>
Special
}

View File

@@ -1,3 +1,5 @@
#pragma warning disable CS1591
using System.Net;
namespace MediaBrowser.Model.Net

View File

@@ -1,9 +1,12 @@
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Net
{
/// <summary>
/// Class WebSocketMessage
/// Class WebSocketMessage.
/// </summary>
/// <typeparam name="T"></typeparam>
public class WebSocketMessage<T>