]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: qc_do_build_hdshk_pkt() does not need to pass a copy of CRYPTO frame
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 3 Aug 2021 15:01:25 +0000 (17:01 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
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

index 85c6a3a9eaa00379ffee951590cee03e03db3b84..f6542d88a62e39cb1c6a8536ca609eeb042a16cc 100644 (file)
@@ -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);