From 2f4dfa4ea7105f07ee968dd3233a73cdd7c7a4ce Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 5 Mar 2017 15:32:47 +0800 Subject: [PATCH] rx flow: handle child state change during parent cb --- lib/libwebsockets.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 7d568a15..43da8fbe 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1463,6 +1463,16 @@ lws_close_reason(struct lws *wsi, enum lws_close_status status, LWS_EXTERN int _lws_rx_flow_control(struct lws *wsi) { + struct lws *wsic = wsi->child_list; + + /* if he has children, do those if they were changed */ + while (wsic) { + if (wsic->rxflow_change_to & LWS_RXFLOW_PENDING_CHANGE) + _lws_rx_flow_control(wsic); + + wsic = wsic->sibling_list; + } + /* there is no pending change */ if (!(wsi->rxflow_change_to & LWS_RXFLOW_PENDING_CHANGE)) { lwsl_debug("%s: no pending change\n", __func__);