~ruther/guix-local

866f37fb7e4f3e0bd695a951071383cdff3da8cd — Ludovic Courtès 8 years ago c114c9c
download: Improve efficiency of 'write-request' over TLS.

This is another instance of <https://bugs.gnu.org/22966>.
The Microsoft-IIS/7.5 server at static.nvd.nist.gov would sometimes hang
when receiving our requests byte by byte.

* guix/build/download.scm (tls-wrap) [!guile-2.0]: Add 'setvbuf' call.
1 files changed, 7 insertions(+), 0 deletions(-)

M guix/build/download.scm
M guix/build/download.scm => guix/build/download.scm +7 -0
@@ 306,6 306,13 @@ host name without trailing dot."
      ;; never be closed.  So we use `fileno', but keep a weak reference to
      ;; PORT, so the file descriptor gets closed when RECORD is GC'd.
      (register-tls-record-port record port)

      ;; Write HTTP requests line by line rather than byte by byte:
      ;; <https://bugs.gnu.org/22966>.  This is not possible on Guile 2.0.
      (cond-expand
        (guile-2.0 #f)
        (else (setvbuf record 'line)))

      record)))

(define (ensure-uri uri-or-string)                ;XXX: copied from (web http)