BUG/MINOR: quic: Speed up the handshake completion only one time
It is possible to speed up the handshake completion but only one time
by connection as mentionned in RFC 9002 "6.2.3. Speeding up Handshake Completion".
Add a flag to prevent this process to be run several times
(see https://www.rfc-editor.org/rfc/rfc9002#name-speeding-up-handshake-compl).
Must be backported to 2.6.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 4fd1872..108a6e0 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -2651,7 +2651,8 @@
TRACE_PROTO("Already received CRYPTO data",
QUIC_EV_CONN_RXPKT, qc, pkt, &cfdebug);
if (qc_is_listener(ctx->qc) &&
- qel == &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL])
+ qel == &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL] &&
+ !(qc->flags & QUIC_FL_CONN_HANDSHAKE_SPEED_UP))
fast_retrans = 1;
break;
}
@@ -2810,7 +2811,9 @@
struct quic_enc_level *iqel = &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL];
struct quic_enc_level *hqel = &qc->els[QUIC_TLS_ENC_LEVEL_HANDSHAKE];
+ TRACE_PROTO("speeding up handshake completion", QUIC_EV_CONN_PRSHPKT, qc);
qc_prep_hdshk_fast_retrans(qc, &iqel->pktns->tx.frms, &hqel->pktns->tx.frms);
+ qc->flags |= QUIC_FL_CONN_HANDSHAKE_SPEED_UP;
}
/* The server must switch from INITIAL to HANDSHAKE handshake state when it