[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#45409] [PATCH v4 08/13] http-client: Accept #:open-connection in ht
From: |
Christopher Baines |
Subject: |
[bug#45409] [PATCH v4 08/13] http-client: Accept #:open-connection in http-fetch. |
Date: |
Sat, 16 Jan 2021 13:57:58 +0000 |
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 3aba3b28c1..2d7458a56e 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
--
2.30.0
- [bug#45409] [PATCH v4 01/13] substitute: Remove buffer handling from fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 02/13] substitute: Remove connection handling from fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 04/13] guix: Move http-multiple-get to (guix http-client)., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 11/13] substitute: Remove redundant fetch arguments., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 05/13] http-client: Add error handling to http-multiple-get., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 06/13] substitute: open-connection-for-uri/maybe add #:verify-certificate?., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 07/13] substitute: Stop using call-with-cached-connection in fetch-narinfos., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 03/13] substitute: Remove redundant let block from fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 10/13] substitute: Remove now redundant connection caching helpers., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 12/13] substitute: Inline fetch in to process-substitutes., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 08/13] http-client: Accept #:open-connection in http-fetch.,
Christopher Baines <=
- [bug#45409] [PATCH v4 13/13] substitute: Remove fetch-narinfos use open-connection-for-uri/maybe., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 09/13] substitute: Change connection cache handling in process-substitution., Christopher Baines, 2021/01/16