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:
parent
d42a7900d6
commit
c295f8014a
1 changed files with 8 additions and 6 deletions
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Reference in a new issue