Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2016-08-16 16:15:05 +0300
committerMarek Safar <marek.safar@gmail.com>2016-08-16 16:16:01 +0300
commitd9e045251d57474528dbae0a284a5cd6314f06a3 (patch)
treeee23ff16d09c9c360ae16a668e4c87e940f3ba9f
parentca04bb1fb628f737f0226a2ff6d9f313218766d1 (diff)
[System] Put back handling of direct ip addresses to ServicePoint::HostEntry (removed in 932359f). Fixes #42864
-rw-r--r--mcs/class/System/System.Net/ServicePoint.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs
index d58b62bd9e8..2ee8b0c0747 100644
--- a/mcs/class/System/System.Net/ServicePoint.cs
+++ b/mcs/class/System/System.Net/ServicePoint.cs
@@ -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 {