int xqc_send_queue_out_queue_empty()

in src/transport/xqc_send_queue.c [177:207]


int xqc_send_queue_out_queue_empty(xqc_send_queue_t *send_queue)
{
    int empty;
    empty = xqc_list_empty(&send_queue->sndq_send_packets)
            && xqc_list_empty(&send_queue->sndq_send_packets_high_pri)
            && xqc_list_empty(&send_queue->sndq_lost_packets)
            && xqc_list_empty(&send_queue->sndq_pto_probe_packets)
            && xqc_list_empty(&send_queue->sndq_buff_1rtt_packets);
    if (!empty) {
        return empty;
    }

    for (xqc_pkt_num_space_t pns = 0; pns < XQC_PNS_N; ++pns) {
        empty = empty && xqc_list_empty(&send_queue->sndq_unacked_packets[pns]);
    }
    if (!empty) {
        return empty;
    }

    xqc_list_head_t *pos, *next;
    xqc_path_ctx_t *path;
    xqc_list_for_each_safe(pos, next, &send_queue->sndq_conn->conn_paths_list) {
        path = xqc_list_entry(pos, xqc_path_ctx_t, path_list);

        for (xqc_send_type_t type = 0; type < XQC_SEND_TYPE_N; type++) {
            empty = empty && xqc_list_empty(&path->path_schedule_buf[type]);
        }
    }

    return empty;
}