download: Do not leak file descriptors on TLS ports.
authorLudovic Courtès <ludo@gnu.org>
Fri, 3 Jan 2020 14:47:12 +0000 (15:47 +0100)
committerLudovic Courtès <ludo@gnu.org>
Fri, 3 Jan 2020 15:06:26 +0000 (16:06 +0100)
commitf4cde9ac4aedb516c050a30fd999673da434bfa0
tree1927e98b7b8882fc72290de59ad6b00cfade5f32
parent52207b3938d3ccbeb661ba8d0af563cf1e0e3333
download: Do not leak file descriptors on TLS ports.

Fixes <https://bugs.gnu.org/20145>.

* guix/build/download.scm (%tls-ports, register-tls-record-port): Remove.
(tls-wrap): Remove call to 'register-tls-record-port'.  Return a custom
binary input/output port instead.  This is a backport of what Guile
2.2's (web client) module has been doing.
(close-connection): Define as an alias for 'close-port'.
* guix/http-client.scm (http-fetch): Remove #:keep-alive? parameter,
which was ignored and unused.
Pass #:keep-alive? #f to 'http-get'.
* guix/lint.scm (probe-uri): Use 'close-port' instead of 'close-connection'.
* guix/scripts/substitute.scm (http-multiple-get): Likewise.
guix/build/download.scm
guix/http-client.scm
guix/lint.scm
guix/scripts/substitute.scm