guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-59-g679eea


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-59-g679eea4
Date: Tue, 06 Dec 2011 16:12:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=679eea4f0ef7720e0ed3c9ba3fddedf35d1501d6

The branch, stable-2.0 has been updated
       via  679eea4f0ef7720e0ed3c9ba3fddedf35d1501d6 (commit)
       via  fe0c202c0ea4ec1ab502b7e26fa70c9e734e8f6c (commit)
      from  2c27dd57c7ec4a8168e2668aed380594a99dda8f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 679eea4f0ef7720e0ed3c9ba3fddedf35d1501d6
Author: Andy Wingo <address@hidden>
Date:   Tue Dec 6 11:47:41 2011 +0100

    allow URIs of the form file:///etc/hosts
    
    * module/web/uri.scm (parse-authority): Allow empty authorities, so that
      we accept URIs of the form, file:///etc/hosts.
    * test-suite/tests/web-uri.test ("string->uri"): Add tests.

commit fe0c202c0ea4ec1ab502b7e26fa70c9e734e8f6c
Author: Andy Wingo <address@hidden>
Date:   Tue Dec 6 11:46:58 2011 +0100

    Update a comment in (web client)
    
    * module/web/client.scm: Update a comment.

-----------------------------------------------------------------------

Summary of changes:
 module/web/client.scm         |    2 +-
 module/web/uri.scm            |   20 ++++++++++++--------
 test-suite/tests/web-uri.test |   19 +++++++++++++++++--
 3 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/module/web/client.scm b/module/web/client.scm
index 6a04497..b035668 100644
--- a/module/web/client.scm
+++ b/module/web/client.scm
@@ -27,7 +27,7 @@
 ;;; the web server.
 ;;;
 ;;; Another option, good but not as performant, would be to use threads,
-;;; possibly via par-map or futures.
+;;; possibly via a thread pool.
 ;;;
 ;;; Code:
 
diff --git a/module/web/uri.scm b/module/web/uri.scm
index 6f9377c..67ecbae 100644
--- a/module/web/uri.scm
+++ b/module/web/uri.scm
@@ -125,14 +125,18 @@ consistency checks to make sure that the constructed URI 
is valid."
            userinfo-pat host-pat port-pat)))
 
 (define (parse-authority authority fail)
-  (let ((m (regexp-exec authority-regexp authority)))
-    (if (and m (valid-host? (match:substring m 3)))
-        (values (match:substring m 2)
-                (match:substring m 3)
-                (let ((port (match:substring m 5)))
-                  (and port (not (string-null? port))
-                       (string->number port))))
-        (fail))))
+  (if (equal? authority "//")
+      ;; Allow empty authorities: file:///etc/hosts is a synonym of
+      ;; file:/etc/hosts.
+      (values #f #f #f)
+      (let ((m (regexp-exec authority-regexp authority)))
+        (if (and m (valid-host? (match:substring m 3)))
+            (values (match:substring m 2)
+                    (match:substring m 3)
+                    (let ((port (match:substring m 5)))
+                      (and port (not (string-null? port))
+                           (string->number port))))
+            (fail)))))
 
 
 ;;; RFC 3986, #3.
diff --git a/test-suite/tests/web-uri.test b/test-suite/tests/web-uri.test
index 534380a..9118eea 100644
--- a/test-suite/tests/web-uri.test
+++ b/test-suite/tests/web-uri.test
@@ -1,6 +1,6 @@
 ;;;; web-uri.test --- URI library          -*- mode: scheme; coding: utf-8; -*-
 ;;;;
-;;;;   Copyright (C) 2010 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -150,7 +150,22 @@
     (not (string->uri "http://:10";)))
 
   (pass-if "http://foo@";
-    (not (string->uri "http://foo@";))))
+    (not (string->uri "http://foo@";)))
+
+  (pass-if "file:/"
+    (uri=? (string->uri "file:/")
+           #:scheme 'file
+           #:path "/"))
+
+  (pass-if "file:/etc/hosts"
+    (uri=? (string->uri "file:/etc/hosts")
+           #:scheme 'file
+           #:path "/etc/hosts"))
+
+  (pass-if "file:///etc/hosts"
+    (uri=? (string->uri "file:///etc/hosts")
+           #:scheme 'file
+           #:path "/etc/hosts")))
 
 (with-test-prefix "uri->string"
   (pass-if "ftp:"


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]