remove dependancy to watcher type in UDP timeout

This commit is contained in:
yrutschle 2021-11-09 18:12:02 +01:00
parent 8ddff5e388
commit d4d9dbb8e7

View File

@ -126,10 +126,9 @@ static void udp_timeouts(struct loop_info* fd_info)
time_t next_timeout = INT_MAX;
for (int i = 0; i < fd_info->watchers->max_fd; 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 */
if (FD_ISSET(i, &fd_info->watchers->fds_r) || FD_ISSET(i, &fd_info->watchers->fds_w)) {
struct connection* cnx = collection_get_cnx_from_fd(fd_info->collection, i);
if (cnx) {
time_t timeout = udp_timeout(cnx);
@ -145,7 +144,6 @@ static void udp_timeouts(struct loop_info* fd_info)
}
}
}
}
if (next_timeout != INT_MAX)
fd_info->next_timeout = next_timeout;