Changeset 5196 for pjproject/trunk


Ignore:
Timestamp:
Nov 6, 2015 11:36:06 AM (9 years ago)
Author:
nanang
Message:

Re #1894: Fixed high socket descriptor check in ioqueue select, it should be against FD_SETSIZE instead of PJ_IOQUEUE_MAX_HANDLES, as PJ_IOQUEUE_MAX_HANDLES can be lower than FD_SETSIZE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ioqueue_select.c

    r5194 r5196  
    339339     * an fd that is higher than FD_SETSIZE. 
    340340     */ 
    341     if (sizeof(fd_set) < FD_SETSIZE && sock >= PJ_IOQUEUE_MAX_HANDLES) 
    342         return PJ_ETOOBIG; 
     341    if (sizeof(fd_set) < FD_SETSIZE && sock >= FD_SETSIZE) { 
     342        PJ_LOG(4, ("pjlib", "Failed to register socket to ioqueue because " 
     343                            "socket fd is too big (fd=%d/FD_SETSIZE=%d)", 
     344                            sock, FD_SETSIZE)); 
     345        return PJ_ETOOBIG; 
     346    } 
    343347 
    344348    pj_lock_acquire(ioqueue->lock); 
Note: See TracChangeset for help on using the changeset viewer.