Skip to content

Commit

Permalink
Match format specifier to integer width in some logging (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose authored Aug 21, 2023
1 parent a2ee9a3 commit c202027
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions source/v5/mqtt5_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,41 +208,12 @@ static void s_check_timeouts(struct aws_mqtt5_client *client, uint64_t now) {
if (operation->ack_timeout_timepoint_ns < now) {
/* Timeout for this packet has been reached */
aws_mqtt5_packet_id_t packet_id = aws_mqtt5_operation_get_packet_id(operation);

switch (operation->packet_type) {
case AWS_MQTT5_PT_SUBSCRIBE:
/* SUBSCRIBE has timed out. */
AWS_LOGF_INFO(
AWS_LS_MQTT5_CLIENT,
"id=%p: SUBSCRIBE packet with id:%d has timed out",
(void *)client,
packet_id);
break;

case AWS_MQTT5_PT_UNSUBSCRIBE:
/* UNSUBSCRIBE has timed out. */
AWS_LOGF_INFO(
AWS_LS_MQTT5_CLIENT,
"id=%p: UNSUBSCRIBE packet with id:%d has timed out",
(void *)client,
packet_id);
break;

case AWS_MQTT5_PT_PUBLISH:
/* PUBLISH has timed out. */
AWS_LOGF_INFO(
AWS_LS_MQTT5_CLIENT,
"id=%p: PUBLISH packet with id:%d has timed out",
(void *)client,
packet_id);

aws_mqtt5_client_flow_control_state_on_puback(client);
break;

default:
/* something is wrong, there should be no other packet type in this linked list */
break;
}
AWS_LOGF_INFO(
AWS_LS_MQTT5_CLIENT,
"id=%p: %s packet with id:%d has timed out",
(void *)client,
aws_mqtt5_packet_type_to_c_string(operation->packet_type),
(int)packet_id);

struct aws_hash_element *elem = NULL;
aws_hash_table_find(&client->operational_state.unacked_operations_table, &packet_id, &elem);
Expand Down

0 comments on commit c202027

Please sign in to comment.