From 76912c8a56af1841628fbf7cf07de6985aa65ee3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 8 May 2023 23:12:29 +0100 Subject: Remove make-chunked-output-port* as it's now unused --- guix-build-coordinator/utils.scm | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'guix-build-coordinator/utils.scm') diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index a536023..71a9540 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -275,35 +275,6 @@ (setsockopt raw-port SOL_SOCKET SO_RCVTIMEO `(,timeout . 0)) (setsockopt raw-port SOL_SOCKET SO_SNDTIMEO `(,timeout . 0)))) -;; TODO This is a variant of make-chunked-output-port from (web http) in -;; Guile. I think it's more efficient, at least in the guix-build-coordinator -;; use case, but this needs some checking and then maybe this could be pushed -;; upstream to Guile. -(define* (make-chunked-output-port* port #:key (keep-alive? #f) - (buffering 1200)) - (define (%put-string s) - (unless (string-null? s) - (let* ((bv (string->bytevector s "ISO-8859-1")) - (length (bytevector-length bv))) - (put-string port (number->string length 16)) - (put-string port "\r\n") - (put-bytevector port bv) - (put-string port "\r\n")))) - - (define (%put-char c) - (%put-string (list->string (list c)))) - - (define (flush) #t) - (define (close) - (put-string port "0\r\n\r\n") - (force-output port) - (unless keep-alive? - (close-port port))) - (let ((ret (make-soft-port - (vector %put-char %put-string flush #f close) "w"))) - (setvbuf ret 'block buffering) - ret)) - (define* (call-with-streaming-http-request uri content-length callback -- cgit v1.2.3