Browse Source

fixed that select ignored invalid/not open sockets in the fd_sets (bug #50392)

STABLE-2_1_x
goldsimon 9 years ago
parent
commit
3107d4a0fa
  1. 3
      CHANGELOG
  2. 8
      src/api/sockets.c

3
CHANGELOG

@ -26,6 +26,9 @@ HISTORY
++ Bugfixes:
2017-02-24: Simon Goldschmidt
* sockets.c: fixed that select ignored invalid/not open sockets in the fd_sets (bug #50392)
2017-02-16: Simon Goldschmidt
* LWIP_NETCONN_FULLDUPLEX: fixed shutdown during write (bug #50274)

8
src/api/sockets.c

@ -1347,7 +1347,8 @@ lwip_selscan(int maxfdp1, fd_set *readset_in, fd_set *writeset_in, fd_set *excep
}
} else {
SYS_ARCH_UNPROTECT(lev);
/* continue on to next FD in list */
/* no a valid open socket */
return -1;
}
}
/* copy local sets to the ones provided as arguments */
@ -1384,6 +1385,11 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
currently match */
nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset);
if (nready < 0) {
set_errno(EBADF);
return -1;
}
/* If we don't have any current events, then suspend if we are supposed to */
if (!nready) {
if (timeout && timeout->tv_sec == 0 && timeout->tv_usec == 0) {

Loading…
Cancel
Save