Skip to content

Commit

Permalink
removed forced cleansession behavior on a user called disconnect (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbSteveK committed Aug 23, 2022
1 parent eea8afa commit cea176e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions source/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,7 @@ static void s_mqtt_client_shutdown(
break;
case AWS_MQTT_CLIENT_STATE_DISCONNECTING:
/* disconnect requested by user */
/* Successfully shutdown, so clear the outstanding requests */
/* TODO: respect the cleansession, clear the table when needed */

AWS_LOGF_TRACE(
AWS_LS_MQTT_CLIENT,
"id=%p: Discard ongoing requests and pending requests when a disconnect requested by user.",
(void *)connection);
aws_linked_list_move_all_back(&cancelling_requests, &connection->thread_data.ongoing_requests_list);
aws_linked_list_move_all_back(&cancelling_requests, &connection->synced_data.pending_requests_list);
aws_hash_table_clear(&connection->synced_data.outstanding_requests_table);

/* Successfully shutdown, if cleansession is set, ongoing and pending requests will be cleared */
disconnected_state = true;
AWS_LOGF_DEBUG(
AWS_LS_MQTT_CLIENT,
Expand Down

0 comments on commit cea176e

Please sign in to comment.