diff mbox series

[bug#45409,v5,02/14] substitute: Remove connection handling from fetch.

Message ID 20210213134719.19625-2-mail@cbaines.net
State Accepted
Headers show
Series [bug#45409,v5,01/14] substitute: Remove buffer handling from fetch. | expand


Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Christopher Baines Feb. 13, 2021, 1:47 p.m. UTC
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 mbox series


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)))))
      (leave (G_ "unsupported substitute URI scheme: ~a~%")
             (uri->string uri)))))