Skip to content

Commit c5ca0b6

Browse files
committed
update append metrics api
1 parent 3af94a9 commit c5ca0b6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

source/v5/mqtt5_options_storage.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,10 @@ static size_t s_aws_mqtt5_packet_connect_compute_storage_size(const struct aws_m
655655
storage_size += view->client_id.len;
656656
if (view->username != NULL) {
657657
if (view->metrics) {
658-
storage_size += aws_mqtt_append_sdk_metrics_to_username_size(view->username, *view->metrics);
658+
size_t username_size = 0;
659+
aws_mqtt_append_sdk_metrics_to_username(
660+
aws_default_allocator(), view->username, *view->metrics, NULL, &username_size);
661+
storage_size += username_size;
659662
} else {
660663
storage_size += view->username->len;
661664
}
@@ -710,7 +713,7 @@ int aws_mqtt5_packet_connect_storage_init(
710713
if (view->metrics) {
711714
struct aws_byte_cursor username_cur = storage->username;
712715
if (aws_mqtt_append_sdk_metrics_to_username(
713-
allocator, &username_cur, *view->metrics, &metrics_username_buf)) {
716+
allocator, &username_cur, *view->metrics, &metrics_username_buf, NULL)) {
714717
return AWS_OP_ERR;
715718
}
716719
storage->username = aws_byte_cursor_from_buf(&metrics_username_buf);

0 commit comments

Comments
 (0)