fix(feuille.c): check validity of sockets in accept loop
This commit is contained in:
parent
3922c5cabb
commit
fdbbd73010
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Reference in a new issue