From 36a39904044765c7ec6803d9d9c3aa2d777d96fa Mon Sep 17 00:00:00 2001 From: Euripedes Rocha Date: Fri, 18 Jun 2021 14:11:21 +0100 Subject: [PATCH] Removes unnecessary calls to outbox_set_pending The call of this function is unnecessary for PUBACK and PUBCOMP, also the item is deleted on the call of is_valid_mqtt_msg and the function allways fail. --- mqtt_client.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mqtt_client.c b/mqtt_client.c index a71b1fb..459cef3 100644 --- a/mqtt_client.c +++ b/mqtt_client.c @@ -1245,7 +1245,6 @@ static esp_err_t mqtt_process_receive(esp_mqtt_client_handle_t client) case MQTT_MSG_TYPE_PUBACK: if (is_valid_mqtt_msg(client, MQTT_MSG_TYPE_PUBLISH, msg_id)) { ESP_LOGD(TAG, "received MQTT_MSG_TYPE_PUBACK, finish QoS1 publish"); - outbox_set_pending(client->outbox, msg_id, CONFIRMED); client->event.event_id = MQTT_EVENT_PUBLISHED; esp_mqtt_dispatch_event_with_msgid(client); } @@ -1275,7 +1274,6 @@ static esp_err_t mqtt_process_receive(esp_mqtt_client_handle_t client) ESP_LOGD(TAG, "received MQTT_MSG_TYPE_PUBCOMP"); if (is_valid_mqtt_msg(client, MQTT_MSG_TYPE_PUBLISH, msg_id)) { ESP_LOGD(TAG, "Receive MQTT_MSG_TYPE_PUBCOMP, finish QoS2 publish"); - outbox_set_pending(client->outbox, msg_id, CONFIRMED); client->event.event_id = MQTT_EVENT_PUBLISHED; esp_mqtt_dispatch_event_with_msgid(client); }