Hey Danny, > very cool! Thanks :) > 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. The problem is that even with our fiberized implementation, what we pass as "body" is checked in "sanitize-response" procedure of Guile's (web server) module. With the (very) hacky patch attached, I fool sanitize-response, by sending the file name as a bytevector. This allows me to save gigabytes of RAM when downloading disk images. WDYT? Thanks, Mathieu