Subject: Re: [bug#40993] cuirass: Add build products download support.

From: Danny Milosavljevic <[email-masked]>
Date: Fri, 1 May 2020 12:09:14 +0200

Hi Mathieu,

very cool!

Though I agree using sendfile would be much better, especially since the user
can download 800 MB image files there.

The guile (web server) module allows passing a procedure as the #:body, but
then it makes a bytevector out of the result and hard-codes the content-type :P.

Eventually (web server http) http-write is reached, which only supports encoding
bytevectors and #f, that's it.  No files.

So we'd have to overwrite http-write.

But we are using our own (web server fiberized) impl already.

So our impl chould be extended to be able to get and process FDs.

client-loop there has

              (lambda (response body)
                (write-response response client)
                (when body
                  (put-bytevector client body))

which means the "when body" part should be extended to also handle files, not just bytevectors.