From 0562b4cf6f101b95ae7172045262f4ae3e85e09d Mon Sep 17 00:00:00 2001 From: sparky8251 Date: Thu, 19 Sep 2019 10:55:58 -0400 Subject: Remove WAN IP Detection --- Emby.Server.Implementations/ApplicationHost.cs | 49 -------------------------- 1 file changed, 49 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 24f59478c..f642f453d 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1403,17 +1403,6 @@ namespace Emby.Server.Implementations { var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); - string wanAddress; - - if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)) - { - wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false); - } - else - { - wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); - } - return new SystemInfo { HasPendingRestart = HasPendingRestart, @@ -1435,7 +1424,6 @@ namespace Emby.Server.Implementations OperatingSystemDisplayName = OperatingSystem.Name, CanSelfRestart = CanSelfRestart, CanLaunchWebBrowser = CanLaunchWebBrowser, - WanAddress = wanAddress, HasUpdateAvailable = HasUpdateAvailable, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, ServerName = FriendlyName, @@ -1457,24 +1445,12 @@ namespace Emby.Server.Implementations { var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); - string wanAddress; - - if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)) - { - wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false); - } - else - { - wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); - } - return new PublicSystemInfo { Version = ApplicationVersion, ProductName = ApplicationProductName, Id = SystemId, OperatingSystem = OperatingSystem.Id.ToString(), - WanAddress = wanAddress, ServerName = FriendlyName, LocalAddress = localAddress }; @@ -1506,31 +1482,6 @@ namespace Emby.Server.Implementations return null; } - public async Task GetWanApiUrlFromExternal(CancellationToken cancellationToken) - { - const string Url = "http://ipv4.icanhazip.com"; - try - { - using (var response = await HttpClient.Get(new HttpRequestOptions - { - Url = Url, - LogErrorResponseBody = false, - BufferContent = false, - CancellationToken = cancellationToken - }).ConfigureAwait(false)) - { - string res = await response.ReadToEndAsync().ConfigureAwait(false); - return GetWanApiUrl(res.Trim()); - } - } - catch (Exception ex) - { - Logger.LogError(ex, "Error getting WAN Ip address information"); - } - - return null; - } - /// /// Removes the scope id from IPv6 addresses. /// -- cgit v1.2.3 From 208c8b2b9daa13e4980833676a9d60926e03a84b Mon Sep 17 00:00:00 2001 From: sparky8251 Date: Thu, 19 Sep 2019 11:21:19 -0400 Subject: Remove missed unused functions Forgot to remove these in the previous WAN IP detection removal commit --- Emby.Server.Implementations/ApplicationHost.cs | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index f642f453d..c9dccb16a 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1524,32 +1524,6 @@ namespace Emby.Server.Implementations HttpPort.ToString(CultureInfo.InvariantCulture)); } - public string GetWanApiUrl(IPAddress ipAddress) - { - if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6) - { - var str = RemoveScopeId(ipAddress.ToString()); - - return GetWanApiUrl("[" + str + "]"); - } - - return GetWanApiUrl(ipAddress.ToString()); - } - - public string GetWanApiUrl(string host) - { - if (EnableHttps) - { - return string.Format("https://{0}:{1}", - host, - ServerConfigurationManager.Configuration.PublicHttpsPort.ToString(CultureInfo.InvariantCulture)); - } - - return string.Format("http://{0}:{1}", - host, - ServerConfigurationManager.Configuration.PublicPort.ToString(CultureInfo.InvariantCulture)); - } - public Task> GetLocalIpAddresses(CancellationToken cancellationToken) { return GetLocalIpAddressesInternal(true, 0, cancellationToken); -- cgit v1.2.3