fix(feuille.c): check validity of sockets in accept loop

This commit is contained in:
Tom MTT. 2022-12-11 00:41:39 +01:00
parent 3922c5cabb
commit fdbbd73010

View file

@ -93,6 +93,12 @@ void accept_loop(int server)
/* accept loop */ /* accept loop */
int connection; int connection;
while ((connection = accept_connection(server))) { while ((connection = accept_connection(server))) {
/* check if the socket is invalid */
if (connection == -1) {
error("error while accepting incoming connection: %s", strerror(errno));
continue;
}
verbose(1, "--- new incoming connection. connection ID: %d:%d ---", pid, time(0)); verbose(1, "--- new incoming connection. connection ID: %d:%d ---", pid, time(0));
unsigned long paste_size = 0; unsigned long paste_size = 0;