branch: master
commit 7688e9888edc84e5955e4b44f2274fb258cbc792
Author: Ludovic Courtès <[email protected]>
AuthorDate: Mon Sep 25 09:56:32 2023 +0200

    remote: ‘send-log’ ignores ‘close-port’ exceptions.
    
    Previously, ‘close-port’ could throw, leading the calling fiber to
    terminate prematurely.
    
    * src/cuirass/remote.scm (send-log): Ignore errors when closing
    COMPRESSED from the ‘catch’ handler.
---
 src/cuirass/remote.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cuirass/remote.scm b/src/cuirass/remote.scm
index 6d5952f..a691510 100644
--- a/src/cuirass/remote.scm
+++ b/src/cuirass/remote.scm
@@ -351,7 +351,9 @@ PRIVATE-KEY to sign narinfos."
                (dump-port log compressed)
                (close-port compressed))
              (lambda (key . args)
-               (close-port compressed)
+               ;; Closing COMPRESSED flushes it so it might throw to
+               ;; 'zlib-error'.  Ignore it.
+               (false-if-exception (close-port compressed))
                (unless (eq? key 'zlib-error)
                  (apply throw args)))))
          (close-port sock)))

Reply via email to