Removes unnecessary outbox_cleanup

The states that were cleaned by this function, CONFIRMED, are no longer reachable.
Itens were marked with this status previously in PUBCOMP and PUBREL
receive handlers.
This commit is contained in:
Euripedes Rocha
2021-07-01 12:05:14 +01:00
parent e24852a4dc
commit ebef896b00
3 changed files with 0 additions and 16 deletions

View File

@ -56,7 +56,6 @@ int outbox_delete_single_expired(outbox_handle_t outbox, outbox_tick_t current_t
esp_err_t outbox_set_pending(outbox_handle_t outbox, int msg_id, pending_state_t pending);
esp_err_t outbox_set_tick(outbox_handle_t outbox, int msg_id, outbox_tick_t tick);
int outbox_get_size(outbox_handle_t outbox);
esp_err_t outbox_cleanup(outbox_handle_t outbox, int max_size);
void outbox_destroy(outbox_handle_t outbox);
void outbox_delete_all_items(outbox_handle_t outbox);

View File

@ -210,20 +210,6 @@ int outbox_get_size(outbox_handle_t outbox)
return siz;
}
esp_err_t outbox_cleanup(outbox_handle_t outbox, int max_size)
{
while (outbox_get_size(outbox) > max_size) {
outbox_item_handle_t item = outbox_dequeue(outbox, CONFIRMED, NULL);
if (item == NULL) {
return ESP_FAIL;
}
STAILQ_REMOVE(outbox, item, outbox_item, next);
free(item->buffer);
free(item);
}
return ESP_OK;
}
void outbox_delete_all_items(outbox_handle_t outbox)
{
outbox_item_handle_t item, tmp;

View File

@ -1456,7 +1456,6 @@ static void esp_mqtt_task(void *pv)
client->state = MQTT_STATE_INIT;
}
outbox_cleanup(client->outbox, OUTBOX_MAX_SIZE);
break;
case MQTT_STATE_WAIT_RECONNECT: