diff options
Diffstat (limited to 'module/web/client.scm')
-rw-r--r-- | module/web/client.scm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/module/web/client.scm b/module/web/client.scm index 76d9cc45a..3bd22f81b 100644 --- a/module/web/client.scm +++ b/module/web/client.scm @@ -274,17 +274,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). ;; 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-reference uri-or-string) (cond |