guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/14: substitute: Remove connection handling from fetch.


From: guix-commits
Subject: 02/14: substitute: Remove connection handling from fetch.
Date: Mon, 22 Feb 2021 15:44:44 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit 08acee2f98321d57c4faa3ba641a5543b74f10a4
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Jan 7 19:37:20 2021 +0000

    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 88610a0..3239579 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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]