Skip to content

Commit

Permalink
fix: Added missing update to message data
Browse files Browse the repository at this point in the history
When handling big messages the refactoring introduced a regression when
handling big messages, messages larger than the message buffer.
  • Loading branch information
euripedesrocha committed Aug 24, 2023
1 parent 1ca7347 commit cc41d1b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cc41d1b

Please sign in to comment.