tests/echo_srv: make the main server logic resilient to ECONNABORTED from accept()
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Feb 2021 11:22:47 +0000 (12:22 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 5 Feb 2021 13:11:31 +0000 (14:11 +0100)
commitfa7a9b7ab5edf3ca986979b9cdaa08deae3d9308
treeca5a775092545e4349fbd7f356d1721ece859910
parentcd51d80946cdc938cea905b2242144f08ef2fec7
tests/echo_srv: make the main server logic resilient to ECONNABORTED from accept()

That should fix a race where the connect() directly followed by close()
in test_thread_echo_tcp_connect will cause the echo_srv to terminate
early, which results in connect() returning ECONNREFUSED in for other
threads.

This mainly happens on FreeBSD, but it can also happen on Linux.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
tests/echo_srv.c