From f252adb3680cf2447205aeccf757ce10fbd69e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 3 Aug 2021 17:01:25 +0200 Subject: [PATCH] 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. --- src/xprt_quic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 85c6a3a9e..f6542d88a 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -841,6 +841,7 @@ static int quic_crypto_data_cpy(struct quic_enc_level *qel, frm->type = QUIC_FT_CRYPTO; frm->crypto.offset = cf_offset; frm->crypto.len = cf_len; + frm->crypto.qel = qel; 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; list_for_each_entry(cf, &pkt->frms, list) { - crypto->offset = cf->crypto.offset; - crypto->len = cf->crypto.len; - crypto->qel = qel; - if (!qc_build_frm(&pos, end, &frm, pkt, conn)) { + if (!qc_build_frm(&pos, end, cf, pkt, conn)) { ssize_t room = end - pos; TRACE_PROTO("Not enough room", QUIC_EV_CONN_HPKT, conn->conn, NULL, NULL, &room);