diff --git a/lib/server.c b/lib/server.c index 3bfd1de1..18734694 100644 --- a/lib/server.c +++ b/lib/server.c @@ -2238,6 +2238,13 @@ lws_server_socket_service(struct lws_context *context, struct lws *wsi, ah->rxlen = ah->rxpos = 0; goto try_pollout; } + + /* + * make sure ah does not get detached if we + * have live data in the rx + */ + if (ah->rxlen) + wsi->more_rx_waiting = 1; } if (!(ah->rxpos != ah->rxlen && ah->rxlen)) {