From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: bug#10410: guile: uri module confused by domain names starting with numbers, ipv6 addresses Date: Sat, 31 Dec 2011 00:27:53 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=14dae93404fbf193e904b551b61a X-Trace: dough.gmane.org 1325262487 15505 80.91.229.12 (30 Dec 2011 16:28:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2011 16:28:07 +0000 (UTC) Cc: guile-devel@gnu.org To: 10410@debbugs.gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Dec 30 17:28:02 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgfJH-00072Z-Qy for guile-devel@m.gmane.org; Fri, 30 Dec 2011 17:28:00 +0100 Original-Received: from localhost ([::1]:36503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgfJH-0005GR-3S for guile-devel@m.gmane.org; Fri, 30 Dec 2011 11:27:59 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgfJD-0005GM-Hq for guile-devel@gnu.org; Fri, 30 Dec 2011 11:27:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgfJC-0007Bx-5q for guile-devel@gnu.org; Fri, 30 Dec 2011 11:27:55 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:44422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgfJB-0007Bt-UG for guile-devel@gnu.org; Fri, 30 Dec 2011 11:27:54 -0500 Original-Received: by iacb35 with SMTP id b35so27812392iac.0 for ; Fri, 30 Dec 2011 08:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JE46rLeQnnAMh5LvdSbkOmiaGwnTGhqnw+N1A7er2ss=; b=rDZ4k4RNcHnlJldunNeR/2+vcNFTy+zYJ97cE+02iDuFemjyqRhSKVhsXjmNLEwLIS VjJMyf+M7Zag5RONd/u/vkCmju54cFV/wxGh1QxMU19RhoA/uRvVnAKnr53QGnC0wfCN KTrVvDQPpJYW2tLaTZYA2Nt6GPeH2M6Fe6h7U= Original-Received: by 10.50.214.36 with SMTP id nx4mr14745776igc.14.1325262473106; Fri, 30 Dec 2011 08:27:53 -0800 (PST) Original-Received: by 10.231.48.68 with HTTP; Fri, 30 Dec 2011 08:27:53 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13214 Archived-At: --14dae93404fbf193e904b551b61a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 30 December 2011 18:14, Daniel Hartwig wrote: > > `string->uri' requires similar changes to support the ipv6 address > literals. =C2=A0I'm yet to found a very elegant way to do this though it = is > easy enough to simply butcher `authority-pat'. So the issue was really with `parse-authority'. The attached patch cleans this up with support for IPv6 (including dotted-quad notation), fixes some typos in the tests, and adds new tests. With both patches applied the web-uri.test now passes for all tests and I can finally do: scheme@(guile-user)> (string->uri "http://[::ffff:192.0.2.1]/foo") $2 =3D #< scheme: http userinfo: #f host: "[::ffff:192.0.2.1]" port: #f path: "/foo" query: #f fragment: #f> scheme@(guile-user)> (string->uri "http://123.com") $3 =3D #< scheme: http userinfo: #f host: "123.com" port: #f path: "" query: #f fragment: #f> --14dae93404fbf193e904b551b61a Content-Type: text/x-patch; charset=US-ASCII; name="0002-enhance-IPv6-support.patch" Content-Disposition: attachment; filename="0002-enhance-IPv6-support.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gwtet69z1 RnJvbSBiODM5YWE5MDljNjFlZjJlZTY4ZWE2NTJlNmUwMDk1YWZjM2YyZjI0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYW5pZWwgSGFydHdpZyA8bWFuZHlrZUBnbWFpbC5jb20+CkRh dGU6IFNhdCwgMzEgRGVjIDIwMTEgMDA6MTY6NDIgKzA4MDAKU3ViamVjdDogW1BBVENIIDIvMl0g ZW5oYW5jZSBJUHY2IHN1cHBvcnQKCiogbW9kdWxlL3dlYi91cmkuc2NtICh2YWxpZC1ob3N0Pyk6 IFN1cHBvcnQgZG90dGVkLXF1YWQgbm90YXRpb24KICBpbiBJUHY2IGFkZHJlc3Nlcy4KICAocGFy c2UtYXV0aG9yaXR5KTogU3VwcG9ydCBJUHY2IGxpdGVyYWxzLgoqIHRlc3Qtc3VpdGUvdGVzdHMv d2ViLXVyaS50ZXN0OiBBZGQgYW5kIGZpeCB0ZXN0cy4KLS0tCiBtb2R1bGUvd2ViL3VyaS5zY20g ICAgICAgICAgICB8ICAgIDQgKystLQogdGVzdC1zdWl0ZS90ZXN0cy93ZWItdXJpLnRlc3QgfCAg IDE2ICsrKysrKysrKysrKy0tLS0KIDIgZmlsZXMgY2hhbmdlZCwgMTQgaW5zZXJ0aW9ucygrKSwg NiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9tb2R1bGUvd2ViL3VyaS5zY20gYi9tb2R1bGUv d2ViL3VyaS5zY20KaW5kZXggZmYxMzg0Ny4uYjhhNjk1MS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