Skip to content

Commit b82c8f6

Browse files
authored
When MQTT_REPORT_DELETED_MESSAGES, delete QOS messages with id 0
1 parent 9de024c commit b82c8f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mqtt_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ static void mqtt_delete_expired_messages(esp_mqtt_client_handle_t client)
15441544
#if MQTT_REPORT_DELETED_MESSAGES
15451545
// also report the deleted items as MQTT_EVENT_DELETED events if enabled
15461546
int msg_id = 0;
1547-
while ((msg_id = outbox_delete_single_expired(client->outbox, platform_tick_get_ms(), OUTBOX_EXPIRED_TIMEOUT_MS)) > 0) {
1547+
while ((msg_id = outbox_delete_single_expired(client->outbox, platform_tick_get_ms(), OUTBOX_EXPIRED_TIMEOUT_MS)) >= 0) {
15481548
client->event.event_id = MQTT_EVENT_DELETED;
15491549
client->event.msg_id = msg_id;
15501550
if (esp_mqtt_dispatch_event(client) != ESP_OK) {

0 commit comments

Comments
 (0)