diff options
Diffstat (limited to 'guix-build-coordinator/utils.scm')
-rw-r--r-- | guix-build-coordinator/utils.scm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index c833183..bc18081 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -261,7 +261,8 @@ upcoming chunk." gc-enable)) (define* (make-chunked-output-port* port #:key (keep-alive? #f) - (buffering 1200)) + (buffering 1200) + report-bytes-sent) (define heap-allocated-limit (expt 2 20)) ;; 1MiB @@ -276,6 +277,8 @@ upcoming chunk." (put-bytevector port bv) (put-string port "\r\n"))) + (when report-bytes-sent + (report-bytes-sent length)) (let* ((stats (gc-stats)) (initial-gc-times (assq-ref stats 'gc-times))) @@ -304,7 +307,8 @@ upcoming chunk." ret)) (define* (call-with-streaming-http-request uri callback - #:key (headers '())) + #:key (headers '()) + report-bytes-sent) (let* ((port (open-socket-for-uri uri)) (request (build-request @@ -330,7 +334,8 @@ upcoming chunk." (make-chunked-output-port* port #:buffering (expt 2 12) - #:keep-alive? #t))) + #:keep-alive? #t + #:report-bytes-sent report-bytes-sent))) ;; A SIGPIPE will kill Guile, so ignore it (sigaction SIGPIPE |