Skip to content

Commit

Permalink
When MQTT_REPORT_DELETED_MESSAGES, delete QOS messages with id 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Totrasmek authored Nov 6, 2024
1 parent 9de024c commit b82c8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ static void mqtt_delete_expired_messages(esp_mqtt_client_handle_t client)
#if MQTT_REPORT_DELETED_MESSAGES
// also report the deleted items as MQTT_EVENT_DELETED events if enabled
int msg_id = 0;
while ((msg_id = outbox_delete_single_expired(client->outbox, platform_tick_get_ms(), OUTBOX_EXPIRED_TIMEOUT_MS)) > 0) {
while ((msg_id = outbox_delete_single_expired(client->outbox, platform_tick_get_ms(), OUTBOX_EXPIRED_TIMEOUT_MS)) >= 0) {
client->event.event_id = MQTT_EVENT_DELETED;
client->event.msg_id = msg_id;
if (esp_mqtt_dispatch_event(client) != ESP_OK) {
Expand Down

0 comments on commit b82c8f6

Please sign in to comment.