From 7c2e1a716471ea832509076707941945ba94f053 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 11 May 2023 09:59:17 +0100 Subject: Add #:streaming? to call-with-streaming-http-request --- guix-build-coordinator/utils.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index 3349ed4..6d921c6 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -311,7 +311,8 @@ content-length callback #:key (headers '()) - (method 'PUT)) + (method 'PUT) + streaming?) (with-port-timeouts (lambda () (let* ((port (open-socket-for-uri uri)) @@ -342,10 +343,13 @@ (force-output port) (let ((response (read-response port))) - (let ((body (read-response-body response))) - (close-port port) - (values response - body)))))))))) + (if streaming? + (values response + (response-body-port response)) + (let ((body (read-response-body response))) + (close-port port) + (values response + body))))))))))) (define (find-missing-substitutes-for-output store substitute-urls output) (if (valid-path? store output) -- cgit v1.2.3