From cd5d75fed95d99c16ee40de0ea6ede29a63533a2 Mon Sep 17 00:00:00 2001 From: yrutschle Date: Sun, 24 Apr 2022 18:31:27 +0200 Subject: [PATCH] fix off-by-one error that wont time out highest UDP file descriptor --- udp-listener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udp-listener.c b/udp-listener.c index ddde201..06966be 100644 --- a/udp-listener.c +++ b/udp-listener.c @@ -140,7 +140,7 @@ void udp_timeouts(struct loop_info* fd_info) time_t next_timeout = INT_MAX; - for (int i = 0; i < watchers_maxfd(fd_info->watchers); i++) { + for (int i = 0; i <= watchers_maxfd(fd_info->watchers); i++) { /* if it's either in read or write set, there is a connection * behind that file descriptor */ struct connection* cnx = collection_get_cnx_from_fd(fd_info->collection, i);