From 7623848343e02dc7505478aa5cc0ec2244e968c2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 6 May 2015 10:31:11 +0200 Subject: download: Work around Guile small-receive-buffer bug. Previously, code using directly (guix build download) was still affected by . This includes source derivations, the 'guix download' command, and (guix gnu-maintenance). 'guix substitute' was unaffected since it used (guix http-client), which already had the fix. * guix/http-client.scm (open-socket-for-uri): Remove. (http-fetch): Remove #:buffered? argument to 'open-socket-for-uri'; use 'setvbuf' instead. * guix/scripts/substitute.scm (fetch): Likewise. * guix/build/download.scm (open-socket-for-uri): New procedure, taken from guix/http-client.scm, but without the #:buffered? parameter. --- guix/scripts/substitute.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix/scripts/substitute.scm') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index ae97f74d26..31559b7966 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -182,7 +182,9 @@ to the caller without emitting an error message." (close-port port)))) (begin (when (or (not port) (port-closed? port)) - (set! port (open-socket-for-uri uri #:buffered? buffered?))) + (set! port (open-socket-for-uri uri)) + (unless buffered? + (setvbuf port _IONBF))) (http-fetch uri #:text? #f #:port port)))))))) (define-record-type -- cgit v1.2.3