rx flow: handle child state change during parent cb
authorAndy Green <andy@warmcat.com>
Sun, 5 Mar 2017 07:32:47 +0000 (15:32 +0800)
committerAndy Green <andy@warmcat.com>
Sun, 5 Mar 2017 07:32:47 +0000 (15:32 +0800)
lib/libwebsockets.c

index 7d568a15a0a676cb9e406691e6c7448d5eb89733..43da8fbe0642188786f29d104524908531b53297 100755 (executable)
@@ -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__);