MINOR: quic: qc_do_build_hdshk_pkt() does not need to pass a copy of CRYPTO frame

There is no need to pass a copy of CRYPTO frames to qc_build_frm() from
qc_do_build_hdshk_pkt(). Furthermore, after the previous modifications,
qc_do_build_hdshk_pkt() do not build only CRYPTO frame from ->pktns.tx.frms
MT_LIST but any type of frame.
This commit is contained in:
Frédéric Lécaille 2021-08-03 17:01:25 +02:00 committed by Amaury Denoyelle
parent a7348f6f85
commit f252adb368

View File

@ -841,6 +841,7 @@ static int quic_crypto_data_cpy(struct quic_enc_level *qel,
frm->type = QUIC_FT_CRYPTO; frm->type = QUIC_FT_CRYPTO;
frm->crypto.offset = cf_offset; frm->crypto.offset = cf_offset;
frm->crypto.len = cf_len; frm->crypto.len = cf_len;
frm->crypto.qel = qel;
MT_LIST_APPEND(&qel->pktns->tx.frms, &frm->mt_list); MT_LIST_APPEND(&qel->pktns->tx.frms, &frm->mt_list);
} }
@ -3811,10 +3812,7 @@ static int qc_do_build_hdshk_pkt(unsigned char *pos, const unsigned char *end,
struct quic_frame *cf; struct quic_frame *cf;
list_for_each_entry(cf, &pkt->frms, list) { list_for_each_entry(cf, &pkt->frms, list) {
crypto->offset = cf->crypto.offset; if (!qc_build_frm(&pos, end, cf, pkt, conn)) {
crypto->len = cf->crypto.len;
crypto->qel = qel;
if (!qc_build_frm(&pos, end, &frm, pkt, conn)) {
ssize_t room = end - pos; ssize_t room = end - pos;
TRACE_PROTO("Not enough room", QUIC_EV_CONN_HPKT, TRACE_PROTO("Not enough room", QUIC_EV_CONN_HPKT,
conn->conn, NULL, NULL, &room); conn->conn, NULL, NULL, &room);