diff --git a/src/piler-smtp.c b/src/piler-smtp.c index 5e024a72..7d8f7b35 100644 --- a/src/piler-smtp.c +++ b/src/piler-smtp.c @@ -182,8 +182,6 @@ int main(int argc, char **argv){ set_signal_handler(SIGALRM, check_for_client_timeout); set_signal_handler(SIGHUP, initialise_configuration); - alarm(timeout); - // calloc() initialitizes the allocated memory sessions = calloc(cfg.max_connections, sizeof(struct smtp_session)); @@ -202,6 +200,8 @@ int main(int argc, char **argv){ if(daemonise == 1 && daemon(1, 0) == -1) fatal(ERR_DAEMON); #endif + alarm(timeout); + for(;;){ n = epoll_wait(efd, events, cfg.max_connections, -1); for(i=0; i