mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
sspc: close: differentiate between ss and sspc at final wsi close
A second chunk of ss / sspc handling did not get cleaned up along with the other patch from a few weeks ago, it wrongly treats sspc the same as ss. This can cause the wrong thing to be zeroed down, 64-bit and 32-bit builds end up with different victims. This patch makes it understand the difference and treat them accordingly, same as the main for_ss handling.
This commit is contained in:
parent
9e8eb28c72
commit
576bed631f
1 changed files with 21 additions and 7 deletions
|
@ -214,14 +214,28 @@ __lws_free_wsi(struct lws *wsi)
|
|||
|
||||
#if defined(LWS_WITH_SECURE_STREAMS)
|
||||
if (wsi->for_ss) {
|
||||
/*
|
||||
* Make certain it is disconnected from the ss by now
|
||||
*/
|
||||
lws_ss_handle_t *h = (lws_ss_handle_t *)wsi->a.opaque_user_data;
|
||||
|
||||
if (h) {
|
||||
h->wsi = NULL;
|
||||
wsi->a.opaque_user_data = NULL;
|
||||
#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)
|
||||
if (wsi->client_bound_sspc) {
|
||||
lws_sspc_handle_t *h = (lws_sspc_handle_t *)
|
||||
wsi->a.opaque_user_data;
|
||||
if (h) {
|
||||
h->cwsi = NULL;
|
||||
wsi->a.opaque_user_data = NULL;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* Make certain it is disconnected from the ss by now
|
||||
*/
|
||||
lws_ss_handle_t *h = (lws_ss_handle_t *)
|
||||
wsi->a.opaque_user_data;
|
||||
|
||||
if (h) {
|
||||
h->wsi = NULL;
|
||||
wsi->a.opaque_user_data = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue