src/liblsquic/lsquic_send_ctl.c
/* Do not use for STREAM frames
 */
Do not use for STREAM frames
Do not use for STREAM frames
lsquic_packet_out_t *
lsquic_send_ctl_get_writeable_packet (lsquic_send_ctl_t *ctl,
                enum packnum_space pns, unsigned need_at_least,
                const struct network_path *path, int regen_match, int *is_err)
{
    lsquic_packet_out_t *packet_out;
    assert(need_at_least > 0);
    packet_out = lsquic_send_ctl_last_scheduled(ctl, pns, path, regen_match);
    if (packet_out
        && !(packet_out->po_flags & (PO_MINI|PO_STREAM_END|PO_RETX))
        && lsquic_packet_out_avail(packet_out) >= need_at_least)
    {
        return packet_out;
    }
    if (!lsquic_send_ctl_can_send(ctl))
    {
        if (is_err)
            *is_err = 0;
        return NULL;
    }
    packet_out = lsquic_send_ctl_new_packet_out(ctl, need_at_least, pns, path);
    if (packet_out)
    {
        lsquic_packet_out_set_pns(packet_out, pns);
        lsquic_send_ctl_scheduled_one(ctl, packet_out);
    }
    else if (is_err)
        *is_err = 1;
    return packet_out;
}
lsquic_packet_out_t * lsquic_send_ctl_get_writeable_packet ( lsquic_send_ctl_t * ctl , enum packnum_space pns , unsigned need_at_least , const struct network_path * path , int regen_match , int * is_err ) { lsquic_packet_out_t * packet_out ; assert ( need_at_least > 0 ) ; packet_out = lsquic_send_ctl_last_scheduled ( ctl , pns , path , regen_match ) ; if ( packet_out && ! ( packet_out -> po_flags & ( PO_MINI | PO_STREAM_END | PO_RETX ) ) && lsquic_packet_out_avail ( packet_out ) >= need_at_least ) { return packet_out ; } if ( ! lsquic_send_ctl_can_send ( ctl ) ) { if ( is_err ) * is_err = 0 ; return NULL ; } packet_out = lsquic_send_ctl_new_packet_out ( ctl , need_at_least , pns , path ) ; if ( packet_out ) { lsquic_packet_out_set_pns ( packet_out , pns ) ; lsquic_send_ctl_scheduled_one ( ctl , packet_out ) ; } else if ( is_err ) * is_err = 1 ; return packet_out ; }
Do not use for STREAM frames
Do not use for STREAM frames