~ruther/guix-local

310709ae58d945b05705f329bca747f07967cd73 — Ludovic Courtès 11 years ago 0aaca43
substitute: Fix file descriptor leak in 'http-multiple-get'.

In practice we would not leak much since we reconnect after ~100
requests (with nginx running on hydra.gnu.org.)

* guix/scripts/substitute.scm (http-multiple-get): Call 'close-port'
  before 'connect'.
1 files changed, 1 insertions(+), 0 deletions(-)

M guix/scripts/substitute.scm
M guix/scripts/substitute.scm => guix/scripts/substitute.scm +1 -0
@@ 467,6 467,7 @@ to read the response body.  Return the list of results."
             ;; case we have to try again.  Check whether that is the case.
             (match (assq 'connection (response-headers resp))
               (('connection 'close)
                (close-port p)
                (connect requests result))        ;try again
               (_
                (loop tail                        ;keep going