diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp index ad197ebc7..3047402d7 100644 --- a/src/AsyncWebSocket.cpp +++ b/src/AsyncWebSocket.cpp @@ -102,7 +102,7 @@ size_t webSocketSendFrame(AsyncClient *client, bool final, uint8_t opcode, bool return 0; } } - client->send(); + if (!client->send();) return 0; return len; } diff --git a/src/AsyncWebSocket.h b/src/AsyncWebSocket.h index fd9eeed96..9d137288a 100644 --- a/src/AsyncWebSocket.h +++ b/src/AsyncWebSocket.h @@ -24,11 +24,15 @@ #include #if defined(ESP32) || defined(LIBRETUYA) #include +#ifndef WS_MAX_QUEUED_MESSAGES #define WS_MAX_QUEUED_MESSAGES 32 +#endif #else #include +#ifndef WS_MAX_QUEUED_MESSAGES #define WS_MAX_QUEUED_MESSAGES 8 #endif +#endif #include #include "AsyncWebSynchronization.h"