summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-01-07 19:36:17 +0000
committerChristopher Baines <mail@cbaines.net>2021-02-22 20:43:09 +0000
commitfbd61b5d3de353bfa468641d087bc53aaa1e63a5 (patch)
tree3634870ac8020efe6e2a7dccc5656984db202507
parentf1f6e49190a11f926af3bef0d45541cabf47c742 (diff)
downloadguix-fbd61b5d3de353bfa468641d087bc53aaa1e63a5.tar.gz
substitute: Remove buffer handling from fetch.
http-fetch does this, so just set the right option.

* guix/scripts/substitute.scm (fetch): Remove buffering code, and pass
 #:buffered? to http-fetch.
-rwxr-xr-xguix/scripts/substitute.scm3
1 files changed, 1 insertions, 2 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index f9bcead045..88610a0781 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -204,10 +204,9 @@ connection (typically PORT) is kept open once data has been fetched from URI."
              (when (or (not port) (port-closed? port))
                (set! port (guix:open-connection-for-uri
                            uri #:verify-certificate? #f)))
-             (unless (or buffered? (not (file-port? port)))
-               (setvbuf port 'none))
              (http-fetch uri #:text? #f #:port port
                          #:keep-alive? keep-alive?
+                         #:buffered? buffered?
                          #:verify-certificate? #f))))))
     (else
      (leave (G_ "unsupported substitute URI scheme: ~a~%")