1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

adopt: rejection should not loop with listen adoption

This commit is contained in:
Andy Green 2021-03-14 13:53:48 +00:00
parent 60ad3f8791
commit 4b689a1433

View file

@ -43,6 +43,8 @@ _lws_plat_service_forced_tsi(struct lws_context *context, int tsi)
/* any socket with events to service? */
for (n = 0; n < (int)pt->fds_count; n++) {
lws_sockfd_type fd = pt->fds[n].fd;
if (!pt->fds[n].revents)
continue;
@ -52,8 +54,9 @@ _lws_plat_service_forced_tsi(struct lws_context *context, int tsi)
__func__, m);
return -1;
}
/* if something closed, retry this slot */
if (m)
/* if something closed, retry this slot since may have been
* swapped with end fd */
if (m && pt->fds[n].fd != fd)
n--;
}