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

wsimux: immortal: only process immortality once per stream

We can call mark immortal multiple times for a child stream, make sure it
is only processed (and increments the nwsi refcount) the once.
This commit is contained in:
Yichen Gu 2021-11-08 13:42:52 +00:00 committed by Andy Green
parent f8a21fec22
commit cab34801ea

View file

@ -1305,10 +1305,14 @@ lws_mux_mark_immortal(struct lws *wsi)
&& !wsi->client_mux_substream
#endif
) {
lwsl_wsi_err(wsi, "not h2 substream");
lwsl_wsi_err(wsi, "not mux substream");
return;
}
if (wsi->mux_stream_immortal)
/* only need to handle it once per child wsi */
return;
nwsi = lws_get_network_wsi(wsi);
if (!nwsi)
return;