mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-29 18:28:24 +02:00
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:
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
||||
|
Reference in New Issue
Block a user