From 77c4f2f48d3b71117ad60965d1055988f4a6f734 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 7 Jan 2019 17:42:31 +0530 Subject: [PATCH 1/4] doc: Fix minor typo in the HTTP headers documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/ref/web.texi (HTTP Headers): Fix minor typo. Signed-off-by: Ludovic Courtès --- doc/ref/web.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/web.texi b/doc/ref/web.texi index f589cfbf7..24bae64e2 100644 --- a/doc/ref/web.texi +++ b/doc/ref/web.texi @@ -795,7 +795,7 @@ The MIME type of a resource, as a symbol, along with any parameters. (parse-header 'content-type "text/plain;charset=utf-8") @result{} (text/plain (charset . "utf-8")) @end example -Note that the @code{charset} parameter is something is a misnomer, and +Note that the @code{charset} parameter is something of a misnomer, and the HTTP specification admits this. It specifies the @emph{encoding} of the characters, not the character set. @end deftypevr From f2c11dc1815880a767b43fa5ad08badd4761a5c0 Mon Sep 17 00:00:00 2001 From: Paul Morris Date: Sat, 17 Nov 2018 08:54:06 -0500 Subject: [PATCH 2/4] doc: Fix argument list in match-lambda docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/ref/match.texi: Fix argument list for match-lambda. Signed-off-by: Ludovic Courtès --- doc/ref/match.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ref/match.texi b/doc/ref/match.texi index 0fc5105d1..f5ea43118 100644 --- a/doc/ref/match.texi +++ b/doc/ref/match.texi @@ -216,7 +216,7 @@ one-element list containing a @var{person} whose first slot is The @code{(ice-9 match)} module also provides the following convenient syntactic sugar macros wrapping around @code{match}. -@deffn {Scheme Syntax} match-lambda exp clause1 clause2 @dots{} +@deffn {Scheme Syntax} match-lambda clause1 clause2 @dots{} Create a procedure of one argument that matches its argument against each clause, and returns the result of evaluating the corresponding expressions. @@ -236,7 +236,7 @@ expressions. @result{} world @end example -@deffn {Scheme Syntax} match-lambda* exp clause1 clause2 @dots{} +@deffn {Scheme Syntax} match-lambda* clause1 clause2 @dots{} Create a procedure of any number of arguments that matches its argument list against each clause, and returns the result of evaluating the corresponding expressions. From e1225d013ed8673382d6d8f9300dd6b175c8b820 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 24 Jun 2019 10:24:28 -0400 Subject: [PATCH 3/4] Revert "web: Add support for HTTP header continuation lines." Fixes . This reverts commit 73cde5ed7218a090ecee888870908af5445796f0. --- module/web/http.scm | 31 +++++++------------------------ test-suite/tests/web-http.test | 11 +---------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/module/web/http.scm b/module/web/http.scm index f1ca733c1..de61c9495 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -1,6 +1,6 @@ ;;; HTTP messages -;; Copyright (C) 2010-2017, 2019 Free Software Foundation, Inc. +;; Copyright (C) 2010-2017 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 @@ -152,35 +152,18 @@ The default writer will call ‘put-string’." (lambda (val port) (put-string port val))))) -(define spaces-and-tabs - (char-set #\space #\tab)) - -(define (space-or-tab? c) - (case c - ((#\space #\tab) #t) - (else #f))) - (define (read-header-line port) - "Read an HTTP header line, including any continuation lines, and -return the combined string without its final CRLF or LF. Raise a -'bad-header' exception if the line does not end in CRLF or LF, or if EOF -is reached." + "Read an HTTP header line and return it without its final CRLF or LF. +Raise a 'bad-header' exception if the line does not end in CRLF or LF, +or if EOF is reached." (match (%read-line port) (((? string? line) . #\newline) ;; '%read-line' does not consider #\return a delimiter; so if it's ;; there, remove it. We are more tolerant than the RFC in that we ;; tolerate LF-only endings. - (let ((line (if (string-suffix? "\r" line) - (string-drop-right line 1) - line))) - ;; If the next character is a space or tab, then there's at least - ;; one continuation line. Read the continuation lines by calling - ;; 'read-header-line' recursively, and append them to this header - ;; line, folding the leading spaces and tabs to a single space. - (if (space-or-tab? (lookahead-char port)) - (string-append line " " (string-trim (read-header-line port) - spaces-and-tabs)) - line))) + (if (string-suffix? "\r" line) + (string-drop-right line 1) + line)) ((line . _) ;EOF or missing delimiter (bad-header 'read-header-line line)))) diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test index c1cf0882e..63377349c 100644 --- a/test-suite/tests/web-http.test +++ b/test-suite/tests/web-http.test @@ -1,6 +1,6 @@ ;;;; web-http.test --- HTTP library -*- mode: scheme; coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2010-2011, 2014-2017, 2019 Free Software Foundation, Inc. +;;;; Copyright (C) 2010-2011, 2014-2017 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 @@ -242,15 +242,6 @@ (pass-if-round-trip "Cache-Control: acme-cache-extension=100 quux\r\n") (pass-if-round-trip "Cache-Control: acme-cache-extension=\"100, quux\"\r\n") - (let ((str "Cache-Control: acme-cache-extension=\"100,\r\n\t foo,\r\n quux\"\r\n") - (val '(cache-control . ((acme-cache-extension . "100, foo, quux"))))) - (pass-if-equal "continuation lines" - val - (call-with-values (lambda () - (read-header (open-input-string str))) - (lambda (sym val) - (cons sym val))))) - (pass-if-parse connection "close" '(close)) (pass-if-parse connection "Content-Encoding" '(content-encoding)) From 043ed2ae5b7e69c6048f37fd0fd3344479c84349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 25 Jun 2019 14:47:27 +0200 Subject: [PATCH 4/4] ports: Export 'current-load-port'. This binding was forgotten when (ice-9 ports) was introduced in 44b3342c4d5ebd4bbf21c7c7608a5f1a53ba0eb4. Thus it has always been missing in Guile 2.2. * module/ice-9/ports.scm: Export 'current-load-port'. --- module/ice-9/ports.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/ice-9/ports.scm b/module/ice-9/ports.scm index 8eee22988..dbc7ef7a7 100644 --- a/module/ice-9/ports.scm +++ b/module/ice-9/ports.scm @@ -1,5 +1,5 @@ ;;; Ports -;;; Copyright (C) 2016 Free Software Foundation, Inc. +;;; Copyright (C) 2016, 2019 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 License as @@ -31,6 +31,7 @@ %set-port-property! current-input-port current-output-port current-error-port current-warning-port + current-load-port set-current-input-port set-current-output-port set-current-error-port port-mode