1
0
Fork 0
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:
Andy Green 2020-08-03 16:04:03 +01:00
parent 1b4bf38d5e
commit d1d5cf2947

View file

@ -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;