[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/14: http-client: Accept #:open-connection in http-fetch.
From: |
guix-commits |
Subject: |
08/14: http-client: Accept #:open-connection in http-fetch. |
Date: |
Mon, 22 Feb 2021 15:44:46 -0500 (EST) |
cbaines pushed a commit to branch master
in repository guix.
commit 05f38ca8dccc49d9ec70d1f63461976b97d74d52
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Jan 7 20:18:57 2021 +0000
http-client: Accept #:open-connection in http-fetch.
So that an alternative procedure can be passed in, perhaps to perform
connection caching.
* guix/http-client.scm (http-fetch): Add an #:open-connection keyword
argument.
---
guix/http-client.scm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/guix/http-client.scm b/guix/http-client.scm
index 3aba3b2..2d7458a 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -75,6 +75,7 @@
(define* (http-fetch uri #:key port (text? #f) (buffered? #t)
+ (open-connection guix:open-connection-for-uri)
(keep-alive? #f)
(verify-certificate? #t)
(headers '((user-agent . "GNU Guile")))
@@ -97,10 +98,10 @@ Raise an '&http-get-error' condition if downloading fails."
(let loop ((uri (if (string? uri)
(string->uri uri)
uri)))
- (let ((port (or port (guix:open-connection-for-uri uri
- #:verify-certificate?
- verify-certificate?
- #:timeout timeout)))
+ (let ((port (or port (open-connection uri
+ #:verify-certificate?
+ verify-certificate?
+ #:timeout timeout)))
(headers (match (uri-userinfo uri)
((? string? str)
(cons (cons 'Authorization
- branch master updated (f1f6e49 -> 20c08a8), guix-commits, 2021/02/22
- 01/14: substitute: Remove buffer handling from fetch., guix-commits, 2021/02/22
- 02/14: substitute: Remove connection handling from fetch., guix-commits, 2021/02/22
- 03/14: substitute: Remove redundant let block from fetch., guix-commits, 2021/02/22
- 04/14: guix: Move http-multiple-get to (guix http-client)., guix-commits, 2021/02/22
- 05/14: http-client: Add error handling to http-multiple-get., guix-commits, 2021/02/22
- 06/14: substitute: open-connection-for-uri/maybe add #:verify-certificate?., guix-commits, 2021/02/22
- 10/14: substitute: Remove now redundant connection caching helpers., guix-commits, 2021/02/22
- 08/14: http-client: Accept #:open-connection in http-fetch.,
guix-commits <=
- 07/14: substitute: Stop using call-with-cached-connection in fetch-narinfos., guix-commits, 2021/02/22
- 09/14: substitute: Change connection cache handling in process-substitution., guix-commits, 2021/02/22
- 13/14: substitute: Remove fetch-narinfos use open-connection-for-uri/maybe., guix-commits, 2021/02/22
- 11/14: substitute: Remove redundant fetch arguments., guix-commits, 2021/02/22
- 12/14: substitute: Inline fetch in to process-substitutes., guix-commits, 2021/02/22
- 14/14: substitute: Rework connection error handling., guix-commits, 2021/02/22