publish: Use 'sendfile' when possible.

* guix/scripts/publish.scm (http-write): In the
'application/octet-stream' case, use 'sendfile' when OUTPUT is a file
port.
This commit is contained in:
Ludovic Courtès 2017-04-18 00:28:39 +02:00
parent 905ae5276d
commit 339a79fd6a
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -469,7 +469,9 @@ blocking."
size)
client))
(output (response-port response)))
(dump-port input output)
(if (file-port? output)
(sendfile output input size)
(dump-port input output))
(close-port output)
(values)))))
(lambda args