]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Store post handshake frame in ->pktns.tx.frms MT_LIST
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 3 Aug 2021 12:29:03 +0000 (14:29 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
We want to treat all the frames to be built the same way as frames
built during handshake (CRYPTO frames). So, let't store them at the same
place which is an MT_LIST.

src/xprt_quic.c

index f520a9b1785c937cee85f900b59b25947b7d3065..90761c9f2ce0579886f9139a356f9c08b1a8046a 100644 (file)
@@ -2224,37 +2224,39 @@ int qc_send_ppkts(struct qring *qr, struct ssl_sock_ctx *ctx)
  * a HANDSHAKE_DONE frame.
  * Return 1 if succeeded, 0 if not.
  */
-static int quic_build_post_handshake_frames(struct quic_conn *conn)
+static int quic_build_post_handshake_frames(struct quic_conn *qc)
 {
        int i;
+       struct quic_enc_level *qel;
        struct quic_frame *frm;
 
+       qel = &qc->els[QUIC_TLS_ENC_LEVEL_APP];
        /* Only servers must send a HANDSHAKE_DONE frame. */
-       if (!objt_server(conn->conn->target)) {
+       if (!objt_server(qc->conn->target)) {
                frm = pool_alloc(pool_head_quic_frame);
                if (!frm)
                        return 0;
 
                frm->type = QUIC_FT_HANDSHAKE_DONE;
-               LIST_APPEND(&conn->tx.frms_to_send, &frm->list);
+               MT_LIST_APPEND(&qel->pktns->tx.frms, &frm->mt_list);
        }
 
-       for (i = 1; i < conn->tx.params.active_connection_id_limit; i++) {
+       for (i = 1; i < qc->tx.params.active_connection_id_limit; i++) {
                struct quic_connection_id *cid;
 
                frm = pool_alloc(pool_head_quic_frame);
-               cid = new_quic_cid(&conn->cids, i);
+               cid = new_quic_cid(&qc->cids, i);
                if (!frm || !cid)
                        goto err;
 
                quic_connection_id_to_frm_cpy(frm, cid);
-               LIST_APPEND(&conn->tx.frms_to_send, &frm->list);
+               MT_LIST_APPEND(&qel->pktns->tx.frms, &frm->mt_list);
        }
 
     return 1;
 
  err:
-       free_quic_conn_cids(conn);
+       free_quic_conn_cids(qc);
        return 0;
 }