From cab34801ea7841d320ee264e172d849135030291 Mon Sep 17 00:00:00 2001 From: Yichen Gu Date: Mon, 8 Nov 2021 13:42:52 +0000 Subject: [PATCH] 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. --- lib/core-net/wsi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c index 7a0ffeaed..978d1e80c 100644 --- a/lib/core-net/wsi.c +++ b/lib/core-net/wsi.c @@ -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;