From 50a2328f64da2021c007e23e8c5765ba11c083e2 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Mon, 15 Feb 2021 21:47:24 +0100 Subject: [PATCH] Refactored epoll timeout check Signed-off-by: Janos SUTO --- src/piler-smtp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/piler-smtp.c b/src/piler-smtp.c index f44e041a..df8ada84 100644 --- a/src/piler-smtp.c +++ b/src/piler-smtp.c @@ -98,8 +98,6 @@ void check_for_client_timeout(){ } } } - - alarm(cfg.check_for_client_timeout_interval); } @@ -197,7 +195,6 @@ int main(int argc, char **argv){ set_signal_handler(SIGPIPE, SIG_IGN); - set_signal_handler(SIGALRM, check_for_client_timeout); set_signal_handler(SIGHUP, initialise_configuration); // calloc() initialitizes the allocated memory @@ -218,10 +215,8 @@ int main(int argc, char **argv){ if(daemonise == 1 && daemon(1, 0) == -1) fatal(ERR_DAEMON); #endif - alarm(cfg.check_for_client_timeout_interval); - for(;;){ - int n = epoll_wait(efd, events, cfg.max_connections, -1); + int n = epoll_wait(efd, events, cfg.max_connections, 10000); for(i=0; i