From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11561 invoked by alias); 1 Jan 2006 23:35:30 -0000 Received: (qmail 11553 invoked by uid 22791); 1 Jan 2006 23:35:29 -0000 X-Spam-Check-By: sourceware.org Received: from smtp2.syd.swiftdsl.com.au (HELO smtp2.syd.swiftdsl.com.au) (218.214.225.98) by sourceware.org (qpsmtpd/0.31) with SMTP; Sun, 01 Jan 2006 23:35:28 +0000 Received: (qmail 13390 invoked from network); 1 Jan 2006 23:35:29 -0000 Received: from unknown (HELO ?192.168.17.2?) (218.214.50.3) by smtp2.syd.swiftdsl.com.au with SMTP; 1 Jan 2006 23:35:29 -0000 From: "Raif S. Naffah" Reply-To: raif@swiftdsl.com.au To: mauve-discuss@sourceware.org Subject: patch to ensure hostnames w/ extra spaces are recognized Date: Sun, 01 Jan 2006 23:35:00 -0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2961550.ieXA0WGKL7"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200601021036.57527.raif@swiftdsl.com.au> Mailing-List: contact mauve-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00003.txt.bz2 --nextPart2961550.ieXA0WGKL7 Content-Type: multipart/mixed; boundary="Boundary-01=_ReGuDfg0qiQCUts" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_ReGuDfg0qiQCUts Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 367 hello there, pls. find attached a patch to InetAddress.getAllByName that tests for=20 hostname strings with extra space characters. the corresponding ChangeLog entry follows: 2006-01-01 Raif S. Naffah * gnu/testlet/java/net/InetAddress/getAllByName.java (test): Ensure hostname strings with extra spaces are recognized. cheers; rsn --Boundary-01=_ReGuDfg0qiQCUts Content-Type: text/x-diff; charset="us-ascii"; name="mauve-20060102b.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mauve-20060102b.patch" Content-length: 2044 Index: getAllByName.java =================================================================== RCS file: /cvs/mauve/mauve/gnu/testlet/java/net/InetAddress/getAllByName.java,v retrieving revision 1.1 diff -u -r1.1 getAllByName.java --- getAllByName.java 13 Aug 2004 21:59:26 -0000 1.1 +++ getAllByName.java 1 Jan 2006 23:28:56 -0000 @@ -42,5 +42,61 @@ { harness.fail(x.toString()); } + + // getAllByName("") also should return the loopback address + try + { + InetAddress[] addr = InetAddress.getAllByName(""); + harness.check(addr != null); + InetAddress loopback = addr[0]; + harness.check(loopback != null); + harness.check(loopback.isLoopbackAddress()); + } + catch (UnknownHostException x) + { + harness.fail(x.toString()); + } + + // so should getAllByName(" ") + try + { + InetAddress[] addr = InetAddress.getAllByName(" "); + harness.check(addr != null); + InetAddress loopback = addr[0]; + harness.check(loopback != null); + harness.check(loopback.isLoopbackAddress()); + } + catch (UnknownHostException x) + { + harness.fail(x.toString()); + } + + // so should getAllByName("localhost") + try + { + InetAddress[] addr = InetAddress.getAllByName("localhost"); + harness.check(addr != null); + InetAddress loopback = addr[0]; + harness.check(loopback != null); + harness.check(loopback.isLoopbackAddress()); + } + catch (UnknownHostException x) + { + harness.fail(x.toString()); + } + + // so should getAllByName(" localhost ") + try + { + InetAddress[] addr = InetAddress.getAllByName(" localhost "); + harness.check(addr != null); + InetAddress loopback = addr[0]; + harness.check(loopback != null); + harness.check(loopback.isLoopbackAddress()); + } + catch (UnknownHostException x) + { + harness.fail(x.toString()); + } } } --Boundary-01=_ReGuDfg0qiQCUts-- --nextPart2961550.ieXA0WGKL7 Content-Type: application/pgp-signature Content-length: 216 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Que du magnifique iD8DBQBDuGeZ+e1AKnsTRiERA2adAKDlWsVeLCHC6m+q6a8tQ+0IDSdfMgCdGE1Z g7Id2Ic0mrLNkoL5f8lmDVo= =ifPx -----END PGP SIGNATURE----- --nextPart2961550.ieXA0WGKL7--