sync updates

This commit is contained in:
Luke Pulverenti
2015-02-14 14:36:40 -05:00
parent cfa2e5ed1d
commit 10cfb3c43c
8 changed files with 33 additions and 33 deletions

View File

@@ -169,24 +169,27 @@ namespace MediaBrowser.Common.Implementations.Networking
IPAddress address;
if (resolveHost && !IPAddress.TryParse(endpoint, out address))
{
var host = new Uri(endpoint).DnsSafeHost;
Logger.Debug("Resolving host {0}", host);
try
Uri uri;
if (Uri.TryCreate(endpoint, UriKind.RelativeOrAbsolute, out uri))
{
address = GetIpAddresses(host).FirstOrDefault();
var host = uri.DnsSafeHost;
Logger.Debug("Resolving host {0}", host);
if (address != null)
try
{
Logger.Debug("{0} resolved to {1}", host, address);
address = GetIpAddresses(host).FirstOrDefault();
return IsInLocalNetworkInternal(address.ToString(), false);
if (address != null)
{
Logger.Debug("{0} resolved to {1}", host, address);
return IsInLocalNetworkInternal(address.ToString(), false);
}
}
catch (Exception ex)
{
Logger.ErrorException("Error resovling hostname {0}", ex, host);
}
}
catch (Exception ex)
{
Logger.ErrorException("Error resovling hostname {0}", ex, host);
}
}