1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

h2: migration: migrate for_ss

The attribute indicating that a wsi belongs to an SS object also must be
migrated when we split out the original transaction wsi into a new nwsi, if we're
not going to lose track of its affiliation.

Likewise if the affiliated SS object points to the original wsi, we have to
migrate his pointer when we migrate the wsi.

Taking care of this book-keeping is necessary to get correct behaviours at
close-time.
This commit is contained in:
Andy Green 2021-05-07 10:01:59 +01:00
parent 74b96f831a
commit edcf346f9f

View file

@ -1510,6 +1510,18 @@ lws_h2_parse_end_of_frame(struct lws *wsi)
#endif
#endif /* CLIENT */
#if defined(LWS_WITH_SECURE_STREAMS)
if (wsi->for_ss) {
lws_ss_handle_t *h = (lws_ss_handle_t *)lws_get_opaque_user_data(wsi);
h2n->swsi->for_ss = 1;
wsi->for_ss = 0;
if (h->wsi == wsi)
h->wsi = h2n->swsi;
}
#endif
h2n->swsi->a.protocol = wsi->a.protocol;
if (h2n->swsi->user_space &&
!h2n->swsi->user_space_externally_allocated)