Author: atsushi
Date: 2006-07-07 02:30:24 -0400 (Fri, 07 Jul 2006)
New Revision: 62341

Modified:
   trunk/mcs/class/System/System.Net/ChangeLog
   trunk/mcs/class/System/System.Net/Dns.cs
Log:
2006-07-07  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * Dns.cs : (GetHostEntry) when passed IP addresses, it does not issue
          query to DNS. Patch by Petri Latvala.



Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2006-07-07 05:08:29 UTC (rev 
62340)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2006-07-07 06:30:24 UTC (rev 
62341)
@@ -1,3 +1,8 @@
+2006-07-07  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * Dns.cs : (GetHostEntry) when passed IP addresses, it does not issue
+         query to DNS. Patch by Petri Latvala.
+
 2006-07-03 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * CookieContainer.cs: don't send a secure cookie over an insecure

Modified: trunk/mcs/class/System/System.Net/Dns.cs
===================================================================
--- trunk/mcs/class/System/System.Net/Dns.cs    2006-07-07 05:08:29 UTC (rev 
62340)
+++ trunk/mcs/class/System/System.Net/Dns.cs    2006-07-07 06:30:24 UTC (rev 
62341)
@@ -255,7 +255,7 @@
                        if (hostNameOrAddress == null)
                                throw new ArgumentNullException 
("hostNameOrAddress");
 
-                       if (hostNameOrAddress == "0.0.0.0")
+                       if (hostNameOrAddress == "0.0.0.0" || hostNameOrAddress 
== "")
                                hostNameOrAddress = "127.0.0.1";
                        IPAddress addr;
                        if (IPAddress.TryParse (hostNameOrAddress, out addr))
@@ -277,7 +277,19 @@
                        if (hostNameOrAddress == null)
                                throw new ArgumentNullException 
("hostNameOrAddress");
 
-                       return GetHostEntry (hostNameOrAddress).AddressList;
+                       if (hostNameOrAddress == "0.0.0.0" || hostNameOrAddress 
== "")
+                               hostNameOrAddress = "127.0.0.1";
+
+                       IPAddress addr;
+                       if (IPAddress.TryParse (hostNameOrAddress, out addr))
+                       {
+                               return new IPAddress[1] { addr };
+                       }
+                       else
+                       {
+                         
+                               return GetHostEntry 
(hostNameOrAddress).AddressList;
+                       }
                }
 #endif
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to