@@ -198,7 +198,7 @@ int aws_mqtt_append_sdk_metrics_to_username(
198198 }
199199
200200 /* Build metadata value string and add to params_list if metadata entries exist */
201- if (metrics -> metadatas != NULL && metrics -> metadata_count > 0 ) {
201+ if (metrics -> metadata_entries != NULL && metrics -> metadata_count > 0 ) {
202202 struct aws_byte_cursor key_value_delim = aws_byte_cursor_from_c_str ("=" );
203203 struct aws_byte_cursor entry_delim = aws_byte_cursor_from_c_str (";" );
204204 struct aws_byte_cursor open_paren = aws_byte_cursor_from_c_str ("(" );
@@ -207,7 +207,7 @@ int aws_mqtt_append_sdk_metrics_to_username(
207207 /* Calculate size needed for metadata value: (key1=value1;key2=value2;...) */
208208 size_t metadata_value_size = open_paren .len + close_paren .len ;
209209 for (size_t i = 0 ; i < metrics -> metadata_count ; ++ i ) {
210- const struct aws_mqtt_metadata_entry * entry = & metrics -> metadatas [i ];
210+ const struct aws_mqtt_metadata_entry * entry = & metrics -> metadata_entries [i ];
211211 metadata_value_size += entry -> key .len + key_value_delim .len + entry -> value .len ;
212212 if (i < metrics -> metadata_count - 1 ) {
213213 metadata_value_size += entry_delim .len ; /* semicolon separator between entries */
@@ -225,7 +225,7 @@ int aws_mqtt_append_sdk_metrics_to_username(
225225 }
226226
227227 for (size_t i = 0 ; i < metrics -> metadata_count ; ++ i ) {
228- const struct aws_mqtt_metadata_entry * entry = & metrics -> metadatas [i ];
228+ const struct aws_mqtt_metadata_entry * entry = & metrics -> metadata_entries [i ];
229229
230230 if (aws_byte_buf_append (& metadata_value_buf , & entry -> key )) {
231231 goto cleanup ;
@@ -304,9 +304,9 @@ size_t aws_mqtt_iot_metrics_compute_storage_size(const struct aws_mqtt_iot_metri
304304 storage_size += metrics -> library_name .len ;
305305
306306 /* Add storage for metadata entries */
307- if (metrics -> metadatas != NULL && metrics -> metadata_count > 0 ) {
307+ if (metrics -> metadata_entries != NULL && metrics -> metadata_count > 0 ) {
308308 for (size_t i = 0 ; i < metrics -> metadata_count ; ++ i ) {
309- const struct aws_mqtt_metadata_entry * entry = & metrics -> metadatas [i ];
309+ const struct aws_mqtt_metadata_entry * entry = & metrics -> metadata_entries [i ];
310310 storage_size += entry -> key .len ;
311311 storage_size += entry -> value .len ;
312312 }
@@ -345,7 +345,7 @@ struct aws_mqtt_iot_metrics_storage *aws_mqtt_iot_metrics_storage_new(
345345 }
346346
347347 /* Copy metadata entries */
348- if (metrics_options -> metadatas != NULL && metrics_options -> metadata_count > 0 ) {
348+ if (metrics_options -> metadata_entries != NULL && metrics_options -> metadata_count > 0 ) {
349349 if (aws_array_list_init_dynamic (
350350 & metrics_storage -> metadata_entries ,
351351 allocator ,
@@ -356,8 +356,8 @@ struct aws_mqtt_iot_metrics_storage *aws_mqtt_iot_metrics_storage_new(
356356
357357 for (size_t i = 0 ; i < metrics_options -> metadata_count ; ++ i ) {
358358 struct aws_mqtt_metadata_entry entry ;
359- entry .key = metrics_options -> metadatas [i ].key ;
360- entry .value = metrics_options -> metadatas [i ].value ;
359+ entry .key = metrics_options -> metadata_entries [i ].key ;
360+ entry .value = metrics_options -> metadata_entries [i ].value ;
361361
362362 /* Copy key into storage buffer and update cursor */
363363 if (entry .key .len > 0 ) {
@@ -378,7 +378,7 @@ struct aws_mqtt_iot_metrics_storage *aws_mqtt_iot_metrics_storage_new(
378378
379379 /* Set storage_view to point to the metadata entries array */
380380 storage_view -> metadata_count = aws_array_list_length (& metrics_storage -> metadata_entries );
381- storage_view -> metadatas = metrics_storage -> metadata_entries .data ;
381+ storage_view -> metadata_entries = metrics_storage -> metadata_entries .data ;
382382 }
383383
384384 return metrics_storage ;
@@ -417,12 +417,12 @@ int aws_mqtt_validate_iot_metrics(const struct aws_mqtt_iot_metrics *metrics) {
417417 }
418418
419419 /* Validate metadata entries */
420- if (metrics -> metadatas != NULL && metrics -> metadata_count > 0 ) {
420+ if (metrics -> metadata_entries != NULL && metrics -> metadata_count > 0 ) {
421421 for (size_t i = 0 ; i < metrics -> metadata_count ; ++ i ) {
422- if (aws_mqtt_validate_utf8_text (metrics -> metadatas [i ].key )) {
422+ if (aws_mqtt_validate_utf8_text (metrics -> metadata_entries [i ].key )) {
423423 return AWS_OP_ERR ;
424424 }
425- if (aws_mqtt_validate_utf8_text (metrics -> metadatas [i ].value )) {
425+ if (aws_mqtt_validate_utf8_text (metrics -> metadata_entries [i ].value )) {
426426 return AWS_OP_ERR ;
427427 }
428428 }
0 commit comments