diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-09-10 22:35:45 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-09-10 23:14:16 +0200 |
commit | 6b02a448d2d87e043e45905567a7504c7926c2a9 (patch) | |
tree | 8029e6362216a9c796ec733bb75f7b004843260e | |
parent | 1c01a30d6602b087e21f79db0bb973104be411fc (diff) | |
download | patches-6b02a448d2d87e043e45905567a7504c7926c2a9.tar patches-6b02a448d2d87e043e45905567a7504c7926c2a9.tar.gz |
http-client: Backport delimited input port fix from Guile.
* guix/http-client.scm (make-delimited-input-port): Backport Guile
commit 5a10e41.
Monkey-patch 'make-delimited-input-port' for any Guile <= 2.0.11.
-rw-r--r-- | guix/http-client.scm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/guix/http-client.scm b/guix/http-client.scm index 201615ddcb..5cfe05f2e0 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -166,13 +166,15 @@ closes PORT, unless KEEP-ALIVE? is true." (define close (and (not keep-alive?) (lambda () - (close port)))) + (close-port port)))) (make-custom-binary-input-port "delimited input port" read! #f #f close)) - (unless (guile-version>? "2.0.9") + (unless (guile-version>? "2.0.11") ;; Guile <= 2.0.9 had a bug whereby 'response-body-port' would read more ;; than what 'content-length' says. See Guile commit 802a25b. + ;; Guile <= 2.0.12 had a bug whereby the 'close' method of the response + ;; body port would fail with wrong-arg-num. See Guile commit 5a10e41. (module-set! (resolve-module '(web response)) 'make-delimited-input-port make-delimited-input-port))) |