]> git.ipfire.org Git - thirdparty/git.git/commit
daemon: correctly handle soft accept() errors in service_loop
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Fri, 27 Jun 2025 23:14:04 +0000 (16:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Jun 2025 15:31:06 +0000 (08:31 -0700)
commit78b6601ca39015b7c6df9c5c323e9a7df74dee26
tree870492fbb815e3e7124e025069517ecca6033a41
parentcb3b40381e1d5ee32dde96521ad7cfd68eb308a6
daemon: correctly handle soft accept() errors in service_loop

Since df076bdbcc ([PATCH] GIT: Listen on IPv6 as well, if available.,
2005-07-23), the original error checking was included in an inner loop
unchanged, where its effect was different.

Instead of retrying, after a EINTR during accept() in the listening
socket, it will advance to the next one and try with that instead,
leaving the client waiting for another round.

Make sure to retry with the same listener socket that failed originally.

To avoid an unlikely busy loop, fallback to the old behaviour after a
couple of attempts.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c