[Libwebsockets] Spotted something suspicious in core-net/wsi-timeout.c

Olivier Langlois olivier at olivierlanglois.net
Mon Mar 15 20:17:58 CET 2021


In the function lws_set_timout(), there is this block of code:

        if (secs == LWS_TO_KILL_SYNC) {
                lwsl_debug("%s: TO_KILL_SYNC %s\n", __func__, lws_wsi_tag(wsi));
                lws_context_unlock(pt->context);
                lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS,
                                   "to sync kill");
                return;
        }

        if (secs == LWS_TO_KILL_ASYNC)
                secs = 0;

is it me or the second if block is dead code and could be removed?

Greetings,
Olivier

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210315/d3a22745/attachment.htm>


More information about the Libwebsockets mailing list