mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
web: 'tls-wrap' returns an unbuffered custom port.
This mirrors Guix commit b168acae2a01fd84075cc134a6140594a978fde5. * module/web/client.scm (tls-wrap)[unbuffered]: New procedure. Pass the result of 'make-custom-binary-input/output-port' to 'unbuffered'.
This commit is contained in:
parent
e4f54d4b32
commit
c92f2c7df0
1 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue