/* see if there is a message waiting for the server to answer in the ack list, if there is, then process it according to the flag. flag : 0 means it does not need to wait for the timeout to process these packets immediately. usually immediately after reconnecting. 1 means it needs to wait for timeout before processing these messages, usually timeout processing in a stable connection.  */
static void mqtt_ack_list_scan(mqtt_client_t *c, uint8_t flag)
/* see if there is a message waiting for the server to answer in the ack list, if there is, then process it according to the flag. flag : 0 means it does not need to wait for the timeout to process these packets immediately. usually immediately after reconnecting. 1 means it needs to wait for timeout before processing these messages, usually timeout processing in a stable connection.  */
static void mqtt_ack_list_scan(mqtt_client_t *c, uint8_t flag)
{
        ack_handler = LIST_ENTRY(curr, ack_handlers_t, list);
        if ((!pika_platform_thread_timer_is_expired(&ack_handler->timer)) &&
            (flag == 1))
            continue;
        if ((ack_handler->type == PUBACK) || (ack_handler->type == PUBREC) ||
            (ack_handler->type == PUBREL) || (ack_handler->type == PUBCOMP)) {
            mqtt_ack_handler_resend(c, ack_handler);
            continue;
        } else if ((ack_handler->type == SUBACK) ||
                   (ack_handler->type == UNSUBACK)) {
            if (NULL != ack_handler->handler) {
                mqtt_msg_handler_destory(ack_handler->handler);
                ack_handler->handler = NULL;
            }
        }
        mqtt_ack_handler_destroy(ack_handler);
        mqtt_subtract_ack_handler_num(c);
    }
}