From 5b0e93d84c84ab298bfd0226567f6ee1a7537ff2 Mon Sep 17 00:00:00 2001 From: Radim Kolar Date: Fri, 5 Jun 2020 17:26:30 +0200 Subject: [PATCH] Use long, not time_t as timeout. --- include/s_extern.h | 2 +- server/server.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/s_extern.h b/include/s_extern.h index e0a2692..43d5323 100644 --- a/include/s_extern.h +++ b/include/s_extern.h @@ -71,7 +71,7 @@ extern time_t cur_time; extern int shutdowning; RETSIGTYPE server_interrupt (int signum); RETSIGTYPE server_dump (int signum); -int server_loop (int fd,time_t timeout); +int server_loop (int fd,long timeout); int server_reply (struct sockaddr_in *, UBUF *, unsigned int, unsigned int); void serve_file (struct sockaddr_in *, UBUF *, FILE *, unsigned int, unsigned char *); diff --git a/server/server.c b/server/server.c index 2028874..235ab74 100644 --- a/server/server.c +++ b/server/server.c @@ -152,13 +152,15 @@ static void send_error (struct sockaddr_in * from, UBUF * ub, const char * msg) } /**************************************************************************** - * This is the message filter. It is called by main with a timeout value. + * This is the message filter. It is called by main with a timeout value in + * milliseconds. + * * If timeout is -1, it will never time out. Otherwise, it waits for a * message. If timed out, it returns. Otherwise it pass it through checks. * Those message that passed get sent to the dispatch loop. ****************************************************************************/ -int server_loop (int fd, time_t timeout) +int server_loop (int fd, long timeout) { HTAB *hp; const char *ir;