summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-03-10 23:13:23 +0100
committerLudovic Courtès <ludo@gnu.org>2021-03-11 23:19:52 +0100
commitb168acae2a01fd84075cc134a6140594a978fde5 (patch)
tree55c4b83b85c4673f01e74d8ff1210c4ee4585436 /guix/build
parent279d932b1ca7bfbb8657c41a84616dd0dfc6e0a8 (diff)
download: 'tls-wrap' returns an unbuffered custom port.
Partly fixes <https://bugs.gnu.org/46967>. * guix/build/download.scm (tls-wrap)[unbuffered]: New procedure. Pass the result of 'make-custom-binary-input/output-port' to 'unbuffered'.
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/download.scm13
1 files changed, 10 insertions, 3 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index a027cd4cda..f24a1e20df 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -323,17 +323,24 @@ host name without trailing dot."
(unless (port-closed? record)
(close-port record)))
+ (define (unbuffered port)
+ (setvbuf port 'none)
+ port)
+
(setvbuf record 'block)
;; Return a port that wraps RECORD to ensure that closing it also
;; closes PORT, the actual socket port, and its file descriptor.
+ ;; Make sure it does not introduce extra buffering (custom ports
+ ;; are buffered by default as of Guile 3.0.5).
;; XXX: This wrapper would be unnecessary if GnuTLS could
;; automatically close SESSION's file descriptor when RECORD is
;; closed, but that doesn't seem to be possible currently (as of
;; 3.6.9).
- (make-custom-binary-input/output-port "gnutls wrapped port" read! write!
- get-position set-position!
- close))))
+ (unbuffered
+ (make-custom-binary-input/output-port "gnutls wrapped port" read! write!
+ get-position set-position!
+ close)))))
(define (ensure-uri uri-or-string) ;XXX: copied from (web http)
(cond