]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Send two ack-eliciting packets when probing packet number spaces
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 17 Jan 2022 13:26:12 +0000 (14:26 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 20 Jan 2022 15:43:06 +0000 (16:43 +0100)
This is to avoid too much PTO timer expirations for 01RTT and Handshake packet
number spaces. Furthermore we are not limited by the anti-amplication for 01RTT
packet number space. According to the RFC we can send up to two packets.

src/xprt_quic.c

index f56ea0cd2d3edc863003653eeb9ba82c12a89e49..e5b7c7d62b305d59e0ef8cbdf5e465bc89e5da38 100644 (file)
@@ -3394,11 +3394,14 @@ static struct task *process_timer(struct task *task, void *ctx, unsigned int sta
        st = HA_ATOMIC_LOAD(&qc->state);
        if (qc->path->in_flight) {
                pktns = quic_pto_pktns(qc, st >= QUIC_HS_ST_COMPLETE, NULL);
-               if (qc_is_listener(qc) &&
-                   pktns == &qc->pktns[QUIC_TLS_PKTNS_HANDSHAKE] &&
-                   qc->pktns[QUIC_TLS_PKTNS_INITIAL].tx.in_flight)
-                   qc->pktns[QUIC_TLS_PKTNS_INITIAL].tx.pto_probe = 1;
-               pktns->tx.pto_probe = 1;
+               if (pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL]) {
+                       pktns->tx.pto_probe = 1;
+                       if (qc->pktns[QUIC_TLS_PKTNS_HANDSHAKE].tx.in_flight)
+                               qc->pktns[QUIC_TLS_PKTNS_HANDSHAKE].tx.pto_probe = 1;
+               }
+               else {
+                       pktns->tx.pto_probe = 2;
+               }
        }
        else if (!qc_is_listener(qc) && st <= QUIC_HS_ST_COMPLETE) {
                struct quic_enc_level *iel = &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL];