]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: quic: Enable the new datagram probing process
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 25 Apr 2022 08:33:12 +0000 (10:33 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Apr 2022 14:22:40 +0000 (16:22 +0200)
Make the two I/O handlers quic_conn_io_cb() and quic_conn_app_io_cb() call
qc_dgrams_retransmit() after probing retransmissions need was detected by
the timer task (qc_process_timer()).
We must modify qc_prep_pkts() to support QUIC_TLS_ENC_LEVEL_NONE as <next_tel>
parameter when called from qc_dgrams_retransmit().

src/xprt_quic.c

index 57f99423e10fa2a3d31a3f5709635b3e98f5b6a8..66ee1989894058b720b8978c106a97e7ab777227 100644 (file)
@@ -3146,7 +3146,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr,
                 * select the next level.
                 */
                if ((tel == QUIC_TLS_ENC_LEVEL_INITIAL || tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE) &&
-                   (LIST_ISEMPTY(frms) && !qel->pktns->tx.pto_probe)) {
+                   next_tel != QUIC_TLS_ENC_LEVEL_NONE && (LIST_ISEMPTY(frms) && !qel->pktns->tx.pto_probe)) {
                        /* 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;
@@ -3904,6 +3904,13 @@ static struct task *quic_conn_app_io_cb(struct task *t, void *context, unsigned
 
        TRACE_PROTO("state", QUIC_EV_CONN_IO_CB, qc, &qc->state);
 
+       /* Retranmissions */
+       if (qc->flags & QUIC_FL_CONN_RETRANS_NEEDED) {
+               TRACE_PROTO("retransmission needed", QUIC_EV_CONN_IO_CB, qc);
+               qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED;
+               qc_dgrams_retransmit(qc);
+       }
+
        if (!MT_LIST_ISEMPTY(&qel->rx.pqpkts) && qc_qel_may_rm_hp(qc, qel))
                qc_rm_hp_pkts(qc, qel);
 
@@ -3942,6 +3949,14 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
        qr = NULL;
        st = qc->state;
        TRACE_PROTO("state", QUIC_EV_CONN_IO_CB, qc, &st);
+
+       /* Retranmissions */
+       if (qc->flags & QUIC_FL_CONN_RETRANS_NEEDED) {
+               TRACE_PROTO("retransmission needed", QUIC_EV_CONN_PHPKTS, qc);
+               qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED;
+               qc_dgrams_retransmit(qc);
+       }
+
        if (qc->flags & QUIC_FL_CONN_IO_CB_WAKEUP) {
                qc->flags &= ~QUIC_FL_CONN_IO_CB_WAKEUP;
                /* The I/O handler has been woken up by the dgram listener