mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
http-client: Remove exception mishandling in 'http-multiple-get'.
Partly fixes <https://bugs.gnu.org/47867>. Reported by Florian Pelz <pelzflorian@pelzflorian.de>. The non-tail recursive call to 'connect' could cause requests to be processed twice, with 'p' possibly closed the second time. Regression introduced in205833b72c
and carried over in45fce38fb0
. * guix/http-client.scm (http-multiple-get): Remove call to 'close-port' and recursive call to 'connect' when the 'write-request' block returns #f.
This commit is contained in:
parent
69ffe875c3
commit
15b6c2a965
1 changed files with 8 additions and 9 deletions
|
@ -214,15 +214,14 @@ (define batch
|
||||||
;; Inherit the HTTP proxying property from P.
|
;; Inherit the HTTP proxying property from P.
|
||||||
(set-http-proxy-port?! buffer (http-proxy-port? p))
|
(set-http-proxy-port?! buffer (http-proxy-port? p))
|
||||||
|
|
||||||
(unless (false-if-networking-error
|
;; Swallow networking errors that could occur due to connection reuse
|
||||||
(begin
|
;; and the like; they will be handled down the road when trying to
|
||||||
(for-each (cut write-request <> buffer) batch)
|
;; read responses.
|
||||||
(put-bytevector p (get))
|
(false-if-networking-error
|
||||||
(force-output p)
|
(begin
|
||||||
#t))
|
(for-each (cut write-request <> buffer) batch)
|
||||||
;; If PORT becomes unusable, open a fresh connection and retry.
|
(put-bytevector p (get))
|
||||||
(close-port p) ; close the broken port
|
(force-output p))))
|
||||||
(connect #f requests result)))
|
|
||||||
|
|
||||||
;; Now start processing responses.
|
;; Now start processing responses.
|
||||||
(let loop ((sent batch)
|
(let loop ((sent batch)
|
||||||
|
|
Loading…
Reference in a new issue