mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-24 19:14:56 +01:00
ipv6 fixes
This commit is contained in:
@@ -97,6 +97,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -322,7 +323,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
{
|
||||
TaskManager.SuspendTriggers = true;
|
||||
}
|
||||
|
||||
|
||||
await base.RunStartupTasks().ConfigureAwait(false);
|
||||
|
||||
Logger.Info("ServerId: {0}", SystemId);
|
||||
@@ -1134,7 +1135,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
|
||||
if (address != null)
|
||||
{
|
||||
return GetLocalApiUrl(address.ToString());
|
||||
return GetLocalApiUrl(address);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -1148,6 +1149,16 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
}
|
||||
}
|
||||
|
||||
public string GetLocalApiUrl(IPAddress ipAddress)
|
||||
{
|
||||
if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6)
|
||||
{
|
||||
return GetLocalApiUrl("[" + ipAddress + "]");
|
||||
}
|
||||
|
||||
return GetLocalApiUrl(ipAddress.ToString());
|
||||
}
|
||||
|
||||
public string GetLocalApiUrl(string host)
|
||||
{
|
||||
return string.Format("http://{0}:{1}",
|
||||
@@ -1180,7 +1191,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
return true;
|
||||
}
|
||||
|
||||
var apiUrl = GetLocalApiUrl(address.ToString());
|
||||
var apiUrl = GetLocalApiUrl(address);
|
||||
apiUrl += "/system/ping";
|
||||
|
||||
if ((DateTime.UtcNow - _lastAddressCacheClear).TotalMinutes >= 5)
|
||||
|
||||
Reference in New Issue
Block a user