This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.net: Problem with resolving 0.0.0.0
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Sun, 30 Nov 2003 22:07:11 +0100
- Subject: FYI: Patch: java.net: Problem with resolving 0.0.0.0
Hi list,
I commited the attached patch which reverts my solution and replaces it with
Jeff Sturms much simpler solution.
Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2382
diff -u -b -B -r1.2382 ChangeLog
--- ChangeLog 28 Nov 2003 22:01:28 -0000 1.2382
+++ ChangeLog 30 Nov 2003 20:38:20 -0000
@@ -1,3 +1,16 @@
+2003-11-30 Jeff Sturm <jsturm@one-point.com>
+
+ * java/net/InetAddress.java:
+ (static): Don'f force DNS request for ANY_IF address.
+
+2003-11-30 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetAddress.java,
+ java/net/natInetAddressNoNet.cc,
+ java/net/natInetAddressPosix.cc,
+ java/net/natInetAddressWin32.cc:
+ Reverted my last patch.
+
2003-11-28 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java
Index: java/net/InetAddress.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/InetAddress.java,v
retrieving revision 1.25
diff -u -b -B -r1.25 InetAddress.java
--- java/net/InetAddress.java 28 Nov 2003 22:01:29 -0000 1.25
+++ java/net/InetAddress.java 30 Nov 2003 20:38:20 -0000
@@ -82,7 +82,7 @@
}
byte[] zeros = { 0, 0, 0, 0 };
- ANY_IF = new InetAddress (zeros, null);
+ ANY_IF = new InetAddress (zeros, "0.0.0.0");
}
/**
@@ -564,23 +564,8 @@
*/
private static native byte[] aton (String host);
- private static native InetAddress[] implLookup(String hostname,
- InetAddress addr,
- boolean all);
-
- private static InetAddress[] lookup (String hostname,
- InetAddress addr, boolean all)
- {
- if (addr.equals(ANY_IF))
- {
- byte[] zeros = { 0, 0, 0, 0 };
- InetAddress[] result = new InetAddress[1];
- result[0] = new InetAddress(zeros, "0.0.0.0");
- return result;
- }
-
- return implLookup(hostname, addr, all);
- }
+ private static native InetAddress[] lookup (String hostname,
+ InetAddress addr, boolean all);
private static native int getFamily (byte[] address);
Index: java/net/natInetAddressNoNet.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natInetAddressNoNet.cc,v
retrieving revision 1.3
diff -u -b -B -r1.3 natInetAddressNoNet.cc
--- java/net/natInetAddressNoNet.cc 28 Nov 2003 22:01:29 -0000 1.3
+++ java/net/natInetAddressNoNet.cc 30 Nov 2003 20:38:20 -0000
@@ -24,7 +24,7 @@
}
JArray<java::net::InetAddress*> *
-java::net::InetAddress::implLookup (jstring, java::net::InetAddress *, jboolean)
+java::net::InetAddress::lookup (jstring, java::net::InetAddress *, jboolean)
{
return NULL;
}
Index: java/net/natInetAddressPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natInetAddressPosix.cc,v
retrieving revision 1.2
diff -u -b -B -r1.2 natInetAddressPosix.cc
--- java/net/natInetAddressPosix.cc 28 Nov 2003 22:01:29 -0000 1.2
+++ java/net/natInetAddressPosix.cc 30 Nov 2003 20:38:20 -0000
@@ -106,8 +106,7 @@
JArray<java::net::InetAddress*> *
-java::net::InetAddress::implLookup (jstring host,
- java::net::InetAddress* iaddr,
+java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
jboolean all)
{
struct hostent *hptr = NULL;
Index: java/net/natInetAddressWin32.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natInetAddressWin32.cc,v
retrieving revision 1.5
diff -u -b -B -r1.5 natInetAddressWin32.cc
--- java/net/natInetAddressWin32.cc 28 Nov 2003 22:01:29 -0000 1.5
+++ java/net/natInetAddressWin32.cc 30 Nov 2003 20:38:20 -0000
@@ -50,8 +50,7 @@
JArray<java::net::InetAddress*> *
-java::net::InetAddress::implLookup (jstring host,
- java::net::InetAddress* iaddr,
+java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
jboolean all)
{
struct hostent *hptr = NULL;