mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
sspc: improve client async close flow
This commit is contained in:
parent
1b4bf38d5e
commit
d1d5cf2947
1 changed files with 12 additions and 1 deletions
|
@ -299,11 +299,22 @@ callback_ss_proxy(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
*/
|
||||
|
||||
if (conn->ss) {
|
||||
struct lws *cw = conn->ss->wsi;
|
||||
/*
|
||||
* The onward connection is around
|
||||
*/
|
||||
lwsl_info("%s: destroying ss.h=%p, ss.wsi=%p\n",
|
||||
__func__, conn->ss, conn->ss->wsi);
|
||||
/* sever relationship with ss about to be deleted */
|
||||
lws_set_opaque_user_data(wsi, NULL);
|
||||
|
||||
if (wsi != cw)
|
||||
/*
|
||||
* The wsi doing the onward connection can no
|
||||
* longer relate to the conn... otherwise when
|
||||
* he gets callbacks he wants to bind to
|
||||
* the ss we are about to delete
|
||||
*/
|
||||
lws_wsi_close(cw, LWS_TO_KILL_ASYNC);
|
||||
conn->wsi = NULL;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue