summaryrefslogtreecommitdiff
path: root/guix/scripts/substitute.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-01-07 19:37:20 +0000
committerChristopher Baines <mail@cbaines.net>2021-02-22 20:43:09 +0000
commit08acee2f98321d57c4faa3ba641a5543b74f10a4 (patch)
tree2ecdd052c5ecc45068e325b4efda2508402774fa /guix/scripts/substitute.scm
parentfbd61b5d3de353bfa468641d087bc53aaa1e63a5 (diff)
substitute: Remove connection handling from fetch.
http-fetch does this, so just use that code instead. * guix/scripts/substitute.scm (fetch): Remove connection handling when the port is closed.
Diffstat (limited to 'guix/scripts/substitute.scm')
-rwxr-xr-xguix/scripts/substitute.scm12
1 files changed, 4 insertions, 8 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 88610a0781..323957910a 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -200,14 +200,10 @@ connection (typically PORT) is kept open once data has been fetched from URI."
(warning (G_ "while fetching ~a: server is somewhat slow~%")
(uri->string uri))
(warning (G_ "try `--no-substitutes' if the problem persists~%")))
- (begin
- (when (or (not port) (port-closed? port))
- (set! port (guix:open-connection-for-uri
- uri #:verify-certificate? #f)))
- (http-fetch uri #:text? #f #:port port
- #:keep-alive? keep-alive?
- #:buffered? buffered?
- #:verify-certificate? #f))))))
+ (http-fetch uri #:text? #f #:port port
+ #:keep-alive? keep-alive?
+ #:buffered? buffered?
+ #:verify-certificate? #f)))))
(else
(leave (G_ "unsupported substitute URI scheme: ~a~%")
(uri->string uri)))))