From d064cd2b677d556fd04df1dc11775126ab2a00b6 Mon Sep 17 00:00:00 2001 From: jobo-zt <75535552@qq.com> Date: Wed, 4 Sep 2024 22:05:27 +0800 Subject: [PATCH] fix loop --- src/main/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/main.c b/src/main/main.c index 768f61c0e..6701d99d8 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -757,11 +757,12 @@ static int fd_poll(struct re *re) for (i = 0; (i < re->maxfds) && (cfds < nfds); i++) { fhs = re->fhsl[i]; - - ++cfds; + if (!fhs || !fhs->fh) continue; - + + ++cfds; + re_sock_t fd = fhs->fd; if (fhs->flags & FD_READ) FD_SET(fd, &rfds);