Dont check fd against FD_SETSIZE if POLL or EPOLL are used

This commit is contained in:
cpq 2023-06-01 22:55:15 +01:00
parent 1dde754724
commit adf124c00c
2 changed files with 2 additions and 2 deletions

View File

@ -4762,7 +4762,7 @@ static void accept_conn(struct mg_mgr *mgr, struct mg_connection *lsn) {
#endif
MG_ERROR(("%lu accept failed, errno %d", lsn->id, MG_SOCK_ERR(-1)));
#if (MG_ARCH != MG_ARCH_WIN32) && !MG_ENABLE_FREERTOS_TCP && \
(MG_ARCH != MG_ARCH_TIRTOS) && !MG_ENABLE_POLL
(MG_ARCH != MG_ARCH_TIRTOS) && !MG_ENABLE_POLL && MG_ENABLE_EPOLL
} else if ((long) fd >= FD_SETSIZE) {
MG_ERROR(("%ld > %ld", (long) fd, (long) FD_SETSIZE));
closesocket(fd);

View File

@ -388,7 +388,7 @@ static void accept_conn(struct mg_mgr *mgr, struct mg_connection *lsn) {
#endif
MG_ERROR(("%lu accept failed, errno %d", lsn->id, MG_SOCK_ERR(-1)));
#if (MG_ARCH != MG_ARCH_WIN32) && !MG_ENABLE_FREERTOS_TCP && \
(MG_ARCH != MG_ARCH_TIRTOS) && !MG_ENABLE_POLL
(MG_ARCH != MG_ARCH_TIRTOS) && !MG_ENABLE_POLL && MG_ENABLE_EPOLL
} else if ((long) fd >= FD_SETSIZE) {
MG_ERROR(("%ld > %ld", (long) fd, (long) FD_SETSIZE));
closesocket(fd);