From: Frédéric Lécaille Date: Mon, 23 Aug 2021 06:54:28 +0000 (+0200) Subject: MINOR: quic: Prepare Application level packet asap. X-Git-Tag: v2.5-dev8~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bade77bf91d9d4c3ff72fe4966e9fe1ebf779e5;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 634c553f83..af0381acb3 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)) {