Imported Upstream version 4.6.0.150

Former-commit-id: 73e3bb1e96dd09dc931c1dfe559d2c7f7b8b02c7
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-23 13:20:38 +00:00
parent 02ac915603
commit b95516a3dd
239 changed files with 4096 additions and 1544 deletions

View File

@ -345,25 +345,25 @@ namespace System.Net
lock (hostE) {
string uriHost = uri.Host;
if (host == null) {
// Cannot do DNS resolution on literal IP addresses
if (uri.HostNameType == UriHostNameType.IPv6 || uri.HostNameType == UriHostNameType.IPv4) {
if (uri.HostNameType == UriHostNameType.IPv6) {
// Remove square brackets
uriHost = uriHost.Substring (1, uriHost.Length - 2);
}
// Creates IPHostEntry
host = new IPHostEntry();
host.AddressList = new IPAddress[] { IPAddress.Parse (uriHost) };
// Cannot do DNS resolution on literal IP addresses
if (uri.HostNameType == UriHostNameType.IPv6 || uri.HostNameType == UriHostNameType.IPv4) {
if (host != null)
return host;
if (uri.HostNameType == UriHostNameType.IPv6) {
// Remove square brackets
uriHost = uriHost.Substring (1, uriHost.Length - 2);
}
} else {
if (!HasTimedOut)
return host;
// Creates IPHostEntry
host = new IPHostEntry();
host.AddressList = new IPAddress[] { IPAddress.Parse (uriHost) };
return host;
}
if (!HasTimedOut)
return host;
lastDnsResolve = DateTime.UtcNow;
try {