From f523b4dc84660e9859b3559106e9fb4ad0efdd86 Mon Sep 17 00:00:00 2001 From: Suren Gabrielyan Date: Tue, 28 Nov 2023 16:35:43 +0400 Subject: [PATCH] fix(websocket): consider failure if return value of `esp_websocket_client_send_with_exact_opcode` less than 0 --- components/esp_websocket_client/esp_websocket_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_websocket_client/esp_websocket_client.c b/components/esp_websocket_client/esp_websocket_client.c index 5088d3dc69..cfd036e041 100644 --- a/components/esp_websocket_client/esp_websocket_client.c +++ b/components/esp_websocket_client/esp_websocket_client.c @@ -1228,7 +1228,7 @@ int esp_websocket_client_send_with_opcode(esp_websocket_client_handle_t client, goto unlock_and_return; } ret = esp_websocket_client_send_with_exact_opcode(client, opcode | WS_TRANSPORT_OPCODES_FIN, data, len, timeout); - if (ret <= 0) { + if (ret < 0) { ESP_LOGE(TAG, "Failed to send the buffer"); goto unlock_and_return; }