Skip to content

Commit 154e9c5

Browse files
committed
Merge branch 'metrics_mqtt5' of github.com:awslabs/aws-c-mqtt into metrics_adapter
2 parents 4b9b267 + 4256aaa commit 154e9c5

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

source/mqtt_iot_sdk_metrics.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ int aws_mqtt_append_sdk_metrics_to_username(
8282
}
8383

8484
if (!metrics) {
85+
if (out_full_username_size) {
86+
*out_full_username_size = original_username->len;
87+
}
88+
8589
if (output_username &&
8690
aws_byte_buf_init(output_username, allocator, original_username->len) == AWS_OP_SUCCESS) {
8791
aws_byte_buf_write(output_username, original_username->ptr, original_username->len);
88-
if (out_full_username_size) {
89-
*out_full_username_size = original_username->len;
90-
}
91-
return AWS_OP_SUCCESS;
9292
}
93-
return AWS_OP_ERR;
93+
94+
return AWS_OP_SUCCESS;
9495
}
9596

9697
if (aws_mqtt_validate_iot_sdk_metrics_utf8(metrics)) {

source/v5/mqtt5_options_storage.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3994,8 +3994,9 @@ struct aws_mqtt5_client_options_storage *aws_mqtt5_client_options_storage_new(
39943994
}
39953995

39963996
options_storage->connect = aws_mem_calloc(allocator, 1, sizeof(struct aws_mqtt5_packet_connect_storage));
3997+
// We pass in a NULL client option as we don't want to store extra metrics info in the connect storage here
39973998
int connect_storage_result =
3998-
aws_mqtt5_packet_connect_storage_init(options_storage->connect, allocator, &connect_options, options);
3999+
aws_mqtt5_packet_connect_storage_init(options_storage->connect, allocator, &connect_options, NULL);
39994000

40004001
aws_byte_buf_clean_up(&auto_assign_id_buf);
40014002
if (connect_storage_result != AWS_OP_SUCCESS) {

0 commit comments

Comments
 (0)