summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjlib/src/pj/ioqueue_select.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pjlib/src/pj/ioqueue_select.c b/pjlib/src/pj/ioqueue_select.c
index a0c964b6..8dd01720 100644
--- a/pjlib/src/pj/ioqueue_select.c
+++ b/pjlib/src/pj/ioqueue_select.c
@@ -338,8 +338,12 @@ PJ_DEF(pj_status_t) pj_ioqueue_register_sock2(pj_pool_t *pool,
* avoid potential memory corruption caused by select() when given
* an fd that is higher than FD_SETSIZE.
*/
- if (sizeof(fd_set) < FD_SETSIZE && sock >= PJ_IOQUEUE_MAX_HANDLES)
- return PJ_ETOOBIG;
+ if (sizeof(fd_set) < FD_SETSIZE && sock >= FD_SETSIZE) {
+ PJ_LOG(4, ("pjlib", "Failed to register socket to ioqueue because "
+ "socket fd is too big (fd=%d/FD_SETSIZE=%d)",
+ sock, FD_SETSIZE));
+ return PJ_ETOOBIG;
+ }
pj_lock_acquire(ioqueue->lock);