diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-18 00:44:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-18 00:44:33 -0500 |
| commit | e7cebb91a73354dc3e0d0b6340c9fbd6511f4406 (patch) | |
| tree | 6f1c368c766c17b7514fe749c0e92e69cd89194a /MediaBrowser.Common/Net | |
| parent | 025905a3e4d50b9a2e07fbf4ff0a203af6604ced (diff) | |
| parent | aaa027f3229073e9a40756c3157d41af2a442922 (diff) | |
Merge pull request #2350 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Common/Net')
| -rw-r--r-- | MediaBrowser.Common/Net/HttpRequestOptions.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/HttpResponseInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/INetworkManager.cs | 27 |
3 files changed, 19 insertions, 23 deletions
diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs index 1a7f414a77..e1ecd6595e 100644 --- a/MediaBrowser.Common/Net/HttpRequestOptions.cs +++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Common.Net /// <value>The URL.</value> public string Url { get; set; } - public DecompressionMethods? DecompressionMethod { get; set; } + public CompressionMethod? DecompressionMethod { get; set; } /// <summary> /// Gets or sets the accept header. @@ -116,7 +116,6 @@ namespace MediaBrowser.Common.Net public HttpRequestOptions() { EnableHttpCompression = true; - BufferContent = true; RequestHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); @@ -142,4 +141,10 @@ namespace MediaBrowser.Common.Net None = 0, Unconditional = 1 } + + public enum CompressionMethod + { + Deflate, + Gzip + } } diff --git a/MediaBrowser.Common/Net/HttpResponseInfo.cs b/MediaBrowser.Common/Net/HttpResponseInfo.cs index 890c893e61..ed941a4474 100644 --- a/MediaBrowser.Common/Net/HttpResponseInfo.cs +++ b/MediaBrowser.Common/Net/HttpResponseInfo.cs @@ -1,5 +1,5 @@ using System; -using System.Collections.Specialized; +using System.Collections.Generic; using System.IO; using System.Net; @@ -50,16 +50,18 @@ namespace MediaBrowser.Common.Net /// Gets or sets the headers. /// </summary> /// <value>The headers.</value> - public NameValueCollection Headers { get; set; } + public Dictionary<string,string> Headers { get; set; } private readonly IDisposable _disposable; public HttpResponseInfo(IDisposable disposable) { _disposable = disposable; + Headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } public HttpResponseInfo() { + Headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } public void Dispose() diff --git a/MediaBrowser.Common/Net/INetworkManager.cs b/MediaBrowser.Common/Net/INetworkManager.cs index de63ddd513..3bc22c07f5 100644 --- a/MediaBrowser.Common/Net/INetworkManager.cs +++ b/MediaBrowser.Common/Net/INetworkManager.cs @@ -2,18 +2,13 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Net; using System.Collections.Generic; using System.Net; +using System.Threading.Tasks; namespace MediaBrowser.Common.Net { public interface INetworkManager { /// <summary> - /// Gets the machine's local ip address - /// </summary> - /// <returns>IPAddress.</returns> - IEnumerable<IPAddress> GetLocalIpAddresses(); - - /// <summary> /// Gets a random port number that is currently available /// </summary> /// <returns>System.Int32.</returns> @@ -46,24 +41,18 @@ namespace MediaBrowser.Common.Net IEnumerable<FileSystemEntryInfo> GetNetworkDevices(); /// <summary> - /// Parses the specified endpointstring. - /// </summary> - /// <param name="endpointstring">The endpointstring.</param> - /// <returns>IPEndPoint.</returns> - IPEndPoint Parse(string endpointstring); - - /// <summary> /// Determines whether [is in local network] [the specified endpoint]. /// </summary> /// <param name="endpoint">The endpoint.</param> /// <returns><c>true</c> if [is in local network] [the specified endpoint]; otherwise, <c>false</c>.</returns> bool IsInLocalNetwork(string endpoint); - /// <summary> - /// Generates a self signed certificate at the locatation specified by <paramref name="certificatePath"/>. - /// </summary> - /// <param name="certificatePath">The path to generate the certificate.</param> - /// <param name="hostname">The common name for the certificate.</param> - void GenerateSelfSignedSslCertificate(string certificatePath, string hostname); + List<IpAddressInfo> GetLocalIpAddresses(); + + IpAddressInfo ParseIpAddress(string ipAddress); + + bool TryParseIpAddress(string ipAddress, out IpAddressInfo ipAddressInfo); + + Task<IpAddressInfo[]> GetHostAddressesAsync(string host); } }
\ No newline at end of file |
