From 4bade77bf91d9d4c3ff72fe4966e9fe1ebf779e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 23 Aug 2021 08:54:28 +0200 Subject: [PATCH] MINOR: quic: Prepare Application level packet asap. It is possible the TLS stack stack provides us with 1-RTT TX secrets at the same time as Handshake secrets are provided. Thanks to this simple patch we can build Application level packets during the handshake. --- src/xprt_quic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 634c553..af0381a 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -2116,6 +2116,9 @@ static int qc_prep_hdshk_pkts(struct qring *qr, struct ssl_sock_ctx *ctx) if ((tel == QUIC_TLS_ENC_LEVEL_INITIAL || tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE) && (MT_LIST_ISEMPTY(&qel->pktns->tx.frms) || (next_tel != QUIC_TLS_ENC_LEVEL_NONE && qc->els[next_tel].pktns->tx.in_flight))) { + /* If QUIC_TLS_ENC_LEVEL_HANDSHAKE was already reached let's try QUIC_TLS_ENC_LEVEL_APP */ + if (tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE && next_tel == tel) + next_tel = QUIC_TLS_ENC_LEVEL_APP; tel = next_tel; qel = &qc->els[tel]; if (!MT_LIST_ISEMPTY(&qel->pktns->tx.frms)) { -- 1.7.10.4