me
/
guix
Archived
1
0
Fork 0

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.
master
Christopher Baines 2021-01-07 20:18:57 +00:00
parent 7b812f7c84
commit 05f38ca8dc
No known key found for this signature in database
GPG Key ID: 5E28A33B0B84F577
1 changed files with 5 additions and 4 deletions

View File

@ -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,7 +98,7 @@ 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
(let ((port (or port (open-connection uri
#:verify-certificate?
verify-certificate?
#:timeout timeout)))