From 3bc2d1e9b712077e65bd3ede576d0a4a98071f52 Mon Sep 17 00:00:00 2001 From: rechrtb Date: Tue, 26 Sep 2023 20:38:33 +0900 Subject: [PATCH] Clear send buffer error manually --- src/Networking/MQTT/MqttClient.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Networking/MQTT/MqttClient.cpp b/src/Networking/MQTT/MqttClient.cpp index 939e6b5ffe..373782fe64 100644 --- a/src/Networking/MQTT/MqttClient.cpp +++ b/src/Networking/MQTT/MqttClient.cpp @@ -151,6 +151,16 @@ bool MqttClient::Spin() noexcept { res = true; } + else + { + // Workaround for a temporary bug where the error MQTT_ERROR_SEND_BUFFER_IS_FULL + // is not cleared even if the send buffer has been drained already. + if (err == MQTT_ERROR_SEND_BUFFER_IS_FULL) + { + client.error = MQTT_OK; + res = true; + } + } } break;