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

Ensure proper cleanup is performed if last websocket is

closed.
This commit is contained in:
Joe Kilner 2015-04-21 10:41:36 +01:00 committed by Andy Green
parent 20636ec970
commit ba8a2f095c

View file

@ -78,12 +78,7 @@ remove_wsi_socket_from_fds(struct libwebsocket_context *context,
lws_libev_io(context, wsi, LWS_EV_STOP | LWS_EV_READ | LWS_EV_WRITE);
if (!--context->fds_count) {
context->protocols[0].callback(context, wsi,
LWS_CALLBACK_LOCK_POLL,
wsi->user_space, (void *) &pa, 0);
goto do_ext;
}
--context->fds_count;
if (wsi->sock > context->max_fds) {
lwsl_err("Socket fd %d too high (%d)\n",
@ -117,7 +112,6 @@ remove_wsi_socket_from_fds(struct libwebsocket_context *context,
/* removed wsi has no position any more */
wsi->position_in_fds_table = -1;
do_ext:
/* remove also from external POLL support via protocol 0 */
if (wsi->sock) {
context->protocols[0].callback(context, wsi,