Properly name some bind address functions, cleanup logging

This commit is contained in:
Shadowghost
2022-10-15 20:57:02 +02:00
parent 87d0158a4a
commit 26d79a5ce3
4 changed files with 29 additions and 30 deletions

View File

@@ -1069,7 +1069,7 @@ namespace Emby.Server.Implementations
return PublishedServerUrl.Trim('/');
}
string smart = NetManager.GetBindInterface(remoteAddr, out var port);
string smart = NetManager.GetBindAddress(remoteAddr, out var port);
return GetLocalApiUrl(smart.Trim('/'), null, port);
}
@@ -1118,7 +1118,7 @@ namespace Emby.Server.Implementations
public string GetApiUrlForLocalAccess(IPAddress ipAddress = null, bool allowHttps = true)
{
// With an empty source, the port will be null
var smart = NetManager.GetBindInterface(ipAddress, out _);
var smart = NetManager.GetBindAddress(ipAddress, out _);
var scheme = !allowHttps ? Uri.UriSchemeHttp : null;
int? port = !allowHttps ? HttpPort : null;
return GetLocalApiUrl(smart, scheme, port);

View File

@@ -92,7 +92,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
var broadcastAddress = NetworkExtensions.GetBroadcastAddress(bindAddress.Subnet);
_logger.LogDebug("Binding UDP server to {Address}", broadcastAddress.ToString());
_logger.LogDebug("Binding UDP server to {Address} on port {PortNumber}", broadcastAddress.ToString(), PortNumber);
_udpServers.Add(new UdpServer(_logger, _appHost, _config, broadcastAddress, PortNumber));
}