Fix socket leak on redirected `*-pure-port' calls.

A port over which a redirection is served to get-pure-port is not closed
if `get-pure-port' follows the redirection.  This leaks file descriptors
on the host machine.
This commit is contained in:
Marc Burns 2012-09-23 19:54:57 -04:00 committed by Eli Barzilay
parent fa0336bfad
commit 25bc661a03

View File

@ -254,6 +254,7 @@
(regexp-match #rx"^HTTP/[0-9]+[.][0-9]+ 3[0-9][0-9]" status))
(cond
[(and redirection-status-line? new-url (not (zero? redirections)))
(close-input-port ip)
(redirection-loop (- redirections 1) new-url)]
[else
(define-values (in-pipe out-pipe) (make-pipe))