[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20/20: http-client: Remove exception mishandling in 'http-multiple-get'.
From: |
guix-commits |
Subject: |
20/20: http-client: Remove exception mishandling in 'http-multiple-get'. |
Date: |
Sun, 25 Apr 2021 08:37:57 -0400 (EDT) |
civodul pushed a commit to branch version-1.3.0
in repository guix.
commit 15b6c2a965e66084f3be2e88439dba408f7613ab
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Apr 24 18:07:09 2021 +0200
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 in 205833b72c5517915a47a50dbe28e7024dc74e57 and
carried over in 45fce38fb0b6c6796906149ade145b8d3594c1c6.
* guix/http-client.scm (http-multiple-get): Remove call to 'close-port'
and recursive call to 'connect' when the 'write-request' block returns #f.
---
guix/http-client.scm | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/guix/http-client.scm b/guix/http-client.scm
index bb1b0ee..10bc278 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -214,15 +214,14 @@ returning."
;; Inherit the HTTP proxying property from P.
(set-http-proxy-port?! buffer (http-proxy-port? p))
- (unless (false-if-networking-error
- (begin
- (for-each (cut write-request <> buffer) batch)
- (put-bytevector p (get))
- (force-output p)
- #t))
- ;; If PORT becomes unusable, open a fresh connection and retry.
- (close-port p) ; close the broken port
- (connect #f requests result)))
+ ;; Swallow networking errors that could occur due to connection reuse
+ ;; and the like; they will be handled down the road when trying to
+ ;; read responses.
+ (false-if-networking-error
+ (begin
+ (for-each (cut write-request <> buffer) batch)
+ (put-bytevector p (get))
+ (force-output p))))
;; Now start processing responses.
(let loop ((sent batch)
- 01/20: Merge remote-tracking branch 'origin/wip-ungrafting' into HEAD, (continued)
- 01/20: Merge remote-tracking branch 'origin/wip-ungrafting' into HEAD, guix-commits, 2021/04/25
- 02/20: build-aux: Relax the regexp used to match NEWS sections., guix-commits, 2021/04/25
- 06/20: build: Use guix system image instead of disk-image, vm-image., guix-commits, 2021/04/25
- 03/20: build: Add doc-update-po as a prerequisite to the dist target., guix-commits, 2021/04/25
- 07/20: .gitignore: Ignore release artifacts., guix-commits, 2021/04/25
- 04/20: .gitignore: Ignore generated .pot files., guix-commits, 2021/04/25
- 08/20: build: Add a check for Guile-Lib., guix-commits, 2021/04/25
- 16/20: po: Remove file that no longer exists., guix-commits, 2021/04/25
- 05/20: gnu: guile-git: Update to 0.5.1., guix-commits, 2021/04/25
- 09/20: import: go: Do not set '%strict-tokenizer?' from the top level., guix-commits, 2021/04/25
- 20/20: http-client: Remove exception mishandling in 'http-multiple-get'.,
guix-commits <=
- 10/20: import: go: Autoload (htmlprag)., guix-commits, 2021/04/25
- 11/20: file-systems: read-partition-{uuid, label} don't swallow ENOENT & co., guix-commits, 2021/04/25
- 17/20: cve: Gracefully handle bogus CVE entries., guix-commits, 2021/04/25
- 19/20: http-client, substitute: Gracefully handle GnuTLS EAGAIN/EINTR., guix-commits, 2021/04/25
- 18/20: doc: Fix cross-reference URL to translated manual., guix-commits, 2021/04/25
- 12/20: gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes]., guix-commits, 2021/04/25
- 14/20: guix-install.sh: Allow overriding the Guix binary source., guix-commits, 2021/04/25
- 13/20: gnu: wireshark: Update to 3.4.5 [security fixes]., guix-commits, 2021/04/25
- 15/20: import: Remove Nix importer., guix-commits, 2021/04/25