guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/06: download: Improve efficiency of 'write-request' over TLS.


From: Ludovic Courtès
Subject: 01/06: download: Improve efficiency of 'write-request' over TLS.
Date: Thu, 16 Nov 2017 02:49:41 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 866f37fb7e4f3e0bd695a951071383cdff3da8cd
Author: Ludovic Courtès <address@hidden>
Date:   Wed Nov 15 09:59:29 2017 +0100

    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.
---
 guix/build/download.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix/build/download.scm b/guix/build/download.scm
index 90de269..4490d22 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]