2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2024-12-29 11:40:16 +01:00

remote: Handle client premature disconnections.

* src/cuirass/remote.scm (receive-logs): Catch premature client disconnections
and report them.
This commit is contained in:
Mathieu Othacehe 2021-12-17 15:09:04 +01:00
parent b9c36654cc
commit 4b7bc873b3
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -298,9 +298,16 @@ PRIVATE-KEY to sign narinfos."
(((_) () ())
(match (accept sock)
((client . address)
(write '(log-server (version 0)) client)
(force-output client)
(proc client))))
(catch 'system-error
(lambda ()
(write '(log-server (version 0)) client)
(force-output client)
(proc client))
(lambda args
(let ((errno (system-error-errno args)))
(when (memv errno (list EPIPE ECONNRESET ECONNABORTED))
(log-error "~a when replying to ~a."
(strerror errno) (fileno client)))))))))
((() () ())
#f)))))