mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
threadpool: disassociate wsi on close
This commit is contained in:
parent
94c50618a4
commit
0ba8df6eb4
3 changed files with 23 additions and 0 deletions
|
@ -505,6 +505,10 @@ just_kill_connection:
|
||||||
lwsl_debug("%s: real just_kill_connection A: %s (sockfd %d)\n", __func__,
|
lwsl_debug("%s: real just_kill_connection A: %s (sockfd %d)\n", __func__,
|
||||||
lws_wsi_tag(wsi), wsi->desc.sockfd);
|
lws_wsi_tag(wsi), wsi->desc.sockfd);
|
||||||
|
|
||||||
|
#if defined(LWS_WITH_THREADPOOL)
|
||||||
|
lws_threadpool_wsi_closing(wsi);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(LWS_WITH_FILE_OPS) && (defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2))
|
#if defined(LWS_WITH_FILE_OPS) && (defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2))
|
||||||
if (lwsi_role_http(wsi) && lwsi_role_server(wsi) &&
|
if (lwsi_role_http(wsi) && lwsi_role_server(wsi) &&
|
||||||
wsi->http.fop_fd != NULL)
|
wsi->http.fop_fd != NULL)
|
||||||
|
|
|
@ -1427,6 +1427,9 @@ html_parser_cb(const hubbub_token *token, void *pw);
|
||||||
int
|
int
|
||||||
lws_threadpool_tsi_context(struct lws_context *context, int tsi);
|
lws_threadpool_tsi_context(struct lws_context *context, int tsi);
|
||||||
|
|
||||||
|
void
|
||||||
|
lws_threadpool_wsi_closing(struct lws *wsi);
|
||||||
|
|
||||||
void
|
void
|
||||||
__lws_wsi_remove_from_sul(struct lws *wsi);
|
__lws_wsi_remove_from_sul(struct lws *wsi);
|
||||||
|
|
||||||
|
|
|
@ -1162,6 +1162,22 @@ lws_threadpool_foreach_task_ss(struct lws_ss_handle *ss, void *user,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int
|
||||||
|
disassociate_wsi(struct lws_threadpool_task *task,
|
||||||
|
void *user)
|
||||||
|
{
|
||||||
|
task->args.wsi = NULL;
|
||||||
|
lws_dll2_remove(&task->list);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
lws_threadpool_wsi_closing(struct lws *wsi)
|
||||||
|
{
|
||||||
|
lws_threadpool_foreach_task_wsi(wsi, NULL, disassociate_wsi);
|
||||||
|
}
|
||||||
|
|
||||||
struct lws_threadpool_task *
|
struct lws_threadpool_task *
|
||||||
lws_threadpool_get_task_wsi(struct lws *wsi)
|
lws_threadpool_get_task_wsi(struct lws *wsi)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue