diff --git a/lib/pollfd.c b/lib/pollfd.c index 19905eff..29e14c26 100644 --- a/lib/pollfd.c +++ b/lib/pollfd.c @@ -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,