From cc41d1b852a67cd7643f59cf5d0d4b00a20788fe Mon Sep 17 00:00:00 2001 From: Euripedes Rocha Date: Thu, 24 Aug 2023 09:52:00 +0200 Subject: [PATCH] fix: Added missing update to message data When handling big messages the refactoring introduced a regression when handling big messages, messages larger than the message buffer. --- mqtt_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mqtt_client.c b/mqtt_client.c index 7f9db11..f3eda2b 100644 --- a/mqtt_client.c +++ b/mqtt_client.c @@ -2091,6 +2091,7 @@ int esp_mqtt_client_publish(esp_mqtt_client_handle_t client, const char *topic, ESP_LOGD(TAG, "Sending fragmented message, remains to send %d bytes of %d", remaining_len, len); int write_len = remaining_len > connection->buffer_length ? connection->buffer_length : remaining_len; memcpy(connection->buffer, current_data, write_len); + connection->outbound_message.data = connection->buffer; connection->outbound_message.length = write_len; sending = true; } else {