summaryrefslogtreecommitdiff
path: root/module/web/client.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/client.scm')
-rw-r--r--module/web/client.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/web/client.scm b/module/web/client.scm
index 3d144df41..67d926f8a 100644
--- a/module/web/client.scm
+++ b/module/web/client.scm
@@ -264,7 +264,15 @@ host name without trailing dot."
(close-port port))
(unless (port-closed? record)
(close-port record)))
+
(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.
+ ;; 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))))