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

cancel pipe: mark close when wsi is close

This commit is contained in:
Andy Green 2021-12-08 06:28:16 +00:00
parent fe8170dcdc
commit f7aff789ca

View file

@ -903,6 +903,18 @@ __lws_close_free_wsi_final(struct lws *wsi)
sanity_assert_no_sockfd_traces(wsi->a.context, wsi->desc.sockfd);
}
/* ... if we're closing the cancel pipe, account for it */
{
struct lws_context_per_thread *pt =
&wsi->a.context->pt[(int)wsi->tsi];
if (pt->pipe_wsi == wsi)
pt->pipe_wsi = NULL;
if (pt->dummy_pipe_fds[0] == wsi->desc.sockfd)
pt->dummy_pipe_fds[0] = LWS_SOCK_INVALID;
}
wsi->desc.sockfd = LWS_SOCK_INVALID;
#if defined(LWS_WITH_CLIENT)