Skip to content

Commit

Permalink
cancel pipe: mark close when wsi is close
Browse files Browse the repository at this point in the history
  • Loading branch information
lws-team committed Dec 13, 2021
1 parent fe8170d commit f7aff78
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/core-net/close.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f7aff78

Please sign in to comment.