diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-01 07:43:34 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-01 07:43:34 -0500 |
| commit | dc8fb33a1f5ad474fed88d58a19c1098c68b815f (patch) | |
| tree | f25dbe0019c0ee3f872d3c7d57ac70bed2076b33 /MediaBrowser.Common.Implementations | |
| parent | d7bdb744ca9d4b3955071dfe3c38ed631dbafbfd (diff) | |
updated nuget
Diffstat (limited to 'MediaBrowser.Common.Implementations')
3 files changed, 22 insertions, 5 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index 900009a23..78b0b1389 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Configuration; +using System.Net.Sockets; +using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; @@ -134,9 +135,22 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager request.Referer = options.Referer; } + request.ServicePoint.BindIPEndPointDelegate = BindIPEndPointCallback; + return request; } + private static IPEndPoint BindIPEndPointCallback(ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount) + { + // Prefer local ipv4 + if (remoteEndPoint.AddressFamily == AddressFamily.InterNetworkV6) + { + return new IPEndPoint(IPAddress.IPv6Any, 0); + } + + return new IPEndPoint(IPAddress.Any, 0); + } + private void AddRequestHeaders(HttpWebRequest request, HttpRequestOptions options) { foreach (var header in options.RequestHeaders.ToList()) diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index 2c387a4dd..8da3006a3 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -17,7 +17,9 @@ namespace MediaBrowser.Common.Implementations.Security /// </summary> public class PluginSecurityManager : ISecurityManager { - private const string MBValidateUrl = Constants.Constants.MbAdminUrl + "service/registration/validate"; + private const string MbAdminUrl = "http://www.mb3admin.com/admin/"; + + private const string MBValidateUrl = MbAdminUrl + "service/registration/validate"; /// <summary> /// The _is MB supporter @@ -160,7 +162,7 @@ namespace MediaBrowser.Common.Implementations.Security return new SupporterInfo(); } - var url = Constants.Constants.MbAdminUrl + "/service/supporter/retrieve?key=" + key; + var url = MbAdminUrl + "/service/supporter/retrieve?key=" + key; using (var stream = await _httpClient.Get(url, CancellationToken.None).ConfigureAwait(false)) { diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index b022dc671..275e75188 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -161,7 +161,7 @@ namespace MediaBrowser.Common.Implementations.Updates { "systemid", _applicationHost.SystemId } }; - using (var json = await _httpClient.Post(Constants.Constants.MbAdminUrl + "service/package/retrieveall", data, cancellationToken).ConfigureAwait(false)) + using (var json = await _httpClient.Post(MbAdminUrl + "service/package/retrieveall", data, cancellationToken).ConfigureAwait(false)) { cancellationToken.ThrowIfCancellationRequested(); @@ -172,6 +172,7 @@ namespace MediaBrowser.Common.Implementations.Updates } private Tuple<List<PackageInfo>, DateTime> _lastPackageListResult; + private const string MbAdminUrl = "http://www.mb3admin.com/admin/"; /// <summary> /// Gets all available packages. @@ -203,7 +204,7 @@ namespace MediaBrowser.Common.Implementations.Updates } } - using (var json = await _httpClient.Get(Constants.Constants.MbAdminUrl + "service/MB3Packages.json", cancellationToken).ConfigureAwait(false)) + using (var json = await _httpClient.Get(MbAdminUrl + "service/MB3Packages.json", cancellationToken).ConfigureAwait(false)) { cancellationToken.ThrowIfCancellationRequested(); |
