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.
This commit is contained in:
Euripedes Rocha
2023-08-24 09:52:00 +02:00
parent 1ca73479cb
commit cc41d1b852

View File

@ -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 {