kike: proper shutdown on accept() failure
This commit is contained in:
parent
753eacab42
commit
ccb2797082
8
kike.c
8
kike.c
|
@ -2645,9 +2645,11 @@ on_irc_client_available (const struct pollfd *pfd, void *user_data)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// TODO: handle resource exhaustion (EMFILE, ENFILE) specially
|
// TODO: handle resource exhaustion (EMFILE, ENFILE) specially
|
||||||
// (stop accepting new connections and wait until we close some).
|
// (stop accepting new connections and wait until we close some;
|
||||||
// FIXME: handle this better, bring the server down cleanly.
|
// also set a timer in case of ENFILE).
|
||||||
exit_fatal ("%s: %s", "accept", strerror (errno));
|
print_fatal ("%s: %s", "accept", strerror (errno));
|
||||||
|
irc_initiate_quit (ctx);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->max_connections != 0 && ctx->n_clients >= ctx->max_connections)
|
if (ctx->max_connections != 0 && ctx->n_clients >= ctx->max_connections)
|
||||||
|
|
Loading…
Reference in New Issue