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

extpoll: make sure DEL_POLL_FD only coming once

https://github.com/warmcat/libwebsockets/issues/2500
This commit is contained in:
Daniel 2021-11-22 15:37:18 +00:00 committed by Andy Green
parent ba89af373b
commit 59abab0e79

View file

@ -438,15 +438,17 @@ __remove_wsi_socket_from_fds(struct lws *wsi)
/* removed wsi has no position any more */
wsi->position_in_fds_table = LWS_NO_FDS_POS;
}
#if defined(LWS_WITH_EXTERNAL_POLL)
/* remove also from external POLL support via protocol 0 */
if (lws_socket_is_valid(wsi->desc.sockfd) && wsi->a.vhost &&
wsi->a.vhost->protocols[0].callback(wsi, LWS_CALLBACK_DEL_POLL_FD,
wsi->user_space, (void *) &pa, 0))
ret = -1;
/* remove also from external POLL support via protocol 0 */
if (lws_socket_is_valid(wsi->desc.sockfd) && wsi->a.vhost &&
wsi->a.vhost->protocols[0].callback(wsi,
LWS_CALLBACK_DEL_POLL_FD,
wsi->user_space,
(void *) &pa, 0))
ret = -1;
#endif
}
#if defined(LWS_WITH_SERVER)
if (!context->being_destroyed &&