From 4d64efa5cbeb2994dec39100b6cfd871155acb9e Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sun, 4 Jun 2023 17:11:26 +0200 Subject: [PATCH] sendLiveLedsWs: don't kick clients ... on low memory conditions, as a lot of UI communication depends on web-sockets (thanks @ewoudwijma for pointing this out). --- wled00/ws.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wled00/ws.cpp b/wled00/ws.cpp index 21dbba03..5a655c82 100644 --- a/wled00/ws.cpp +++ b/wled00/ws.cpp @@ -197,9 +197,9 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static" if (wsBuf == nullptr) { // 8266 does not support exceptions #endif wsBuf = nullptr; - DEBUG_PRINTLN(F("WS buffer allocation failed, dropping connections.")); - ws.closeAll(1013); //code 1013 = temporary overload, try again later - ws.cleanupClients(0); //disconnect all clients to release memory + DEBUG_PRINTLN(F("WS buffer allocation failed.")); + //ws.closeAll(1013); //code 1013 = temporary overload, try again later + //ws.cleanupClients(0); //disconnect all clients to release memory ws._cleanBuffers(); } @@ -213,7 +213,7 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static" #ifndef WLED_DISABLE_2D if (strip.isMatrix) { buffer[1] = 2; //version - buffer[2] = min(Segment::maxWidth, (uint16_t) 255); // WLEDMM prevent overflow + buffer[2] = min(Segment::maxWidth, (uint16_t) 255); // WLEDMM prevent overflow on buffer type uint8_t buffer[3] = min(Segment::maxHeight, (uint16_t) 255); //WLEDMM: no skipLines } @@ -253,4 +253,4 @@ void handleWs() #else void handleWs() {} void sendDataWs(AsyncWebSocketClient * client) {} -#endif \ No newline at end of file +#endif