diff --git a/src/MessageOutput.cpp b/src/MessageOutput.cpp index 9db788506..7932b78e9 100644 --- a/src/MessageOutput.cpp +++ b/src/MessageOutput.cpp @@ -109,7 +109,7 @@ void MessageOutputClass::loop() return; } - while (!_lines.empty() && _ws->availableForWriteAll()) { + while (!_lines.empty()) { Syslog.write(_lines.front().data(), _lines.front().size()); _ws->textAll(std::make_shared(std::move(_lines.front()))); _lines.pop(); diff --git a/src/WebApi_ws_console.cpp b/src/WebApi_ws_console.cpp index 51035f6fa..f93c3ea17 100644 --- a/src/WebApi_ws_console.cpp +++ b/src/WebApi_ws_console.cpp @@ -45,6 +45,9 @@ void WebApiWsConsoleClass::reload() void WebApiWsConsoleClass::wsCleanupTaskCb() { - // see: https://github.com/me-no-dev/ESPAsyncWebServer#limiting-the-number-of-web-socket-clients - _ws.cleanupClients(); + // see: https://github.com/ESP32Async/ESPAsyncWebServer#limiting-the-number-of-web-socket-clients + // calling this function without an argument will use a default maximum + // number of clients to keep. since the web console is using quite a lot + // of memory, we only permit two clients at the same time. + _ws.cleanupClients(2); }