aboutsummaryrefslogtreecommitdiff
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 19:53:43 +0000
commit2dbb0a4930abeeccfdddd0126b99afe30e692319 (patch)
tree077b84b5810ea3c04a109f9f0471d224f03e1bb9
parente8b4a270c8c61df3f349333fc73be7154445e5f2 (diff)
downloadguix-2dbb0a4930abeeccfdddd0126b99afe30e692319.tar
guix-2dbb0a4930abeeccfdddd0126b99afe30e692319.tar.gz
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.
-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)))))