From 08acee2f98321d57c4faa3ba641a5543b74f10a4 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 7 Jan 2021 19:37:20 +0000 Subject: 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. --- guix/scripts/substitute.scm | 12 ++++-------- 1 file 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 @@ (define* (fetch uri #:key (buffered? #t) (timeout? #t) (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))))) -- cgit v1.2.3