aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYichen Gu <guyiche@amazon.com>2021-11-08 13:42:52 +0000
committerAndy Green <andy@warmcat.com>2021-11-09 09:28:26 +0000
commitcab34801ea7841d320ee264e172d849135030291 (patch)
treecb1d176cb2a6f4945cce5ef96f4d34cfbc45f5a4
parentf8a21fec225a324e9ff8bc5fc05aeffc001d77aa (diff)
downloadlibwebsockets-cab34801ea7841d320ee264e172d849135030291.tar.gz
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.
-rw-r--r--lib/core-net/wsi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c
index 7a0ffeae..978d1e80 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;