From bbc28e70fd788e0ce2a2bb890aaa6e13be73af47 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Fri, 31 May 2024 22:18:38 +0100 Subject: [PATCH] Fix delayed sending of websocket messages --- .../src/Network/Http/Websocket/WebsocketConnection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sming/Components/Network/src/Network/Http/Websocket/WebsocketConnection.cpp b/Sming/Components/Network/src/Network/Http/Websocket/WebsocketConnection.cpp index e38363e4c0..8e50ecd6d0 100644 --- a/Sming/Components/Network/src/Network/Http/Websocket/WebsocketConnection.cpp +++ b/Sming/Components/Network/src/Network/Http/Websocket/WebsocketConnection.cpp @@ -294,7 +294,11 @@ bool WebsocketConnection::send(IDataSourceStream* source, ws_frame_type_t type, } // Pass stream to connection - return connection->send(sourceRef.release()); + if(!connection->send(sourceRef.release())) { + return false; + } + connection->commit(); + return true; } void WebsocketConnection::broadcast(const char* message, size_t length, ws_frame_type_t type)