]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic-be: I/O handler switch adaptation
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 16 Jan 2024 09:30:13 +0000 (10:30 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Jun 2025 16:37:34 +0000 (18:37 +0200)
For connection to QUIC servers, this patch modifies the moment where the I/O
handler callback is switched to quic_conn_app_io_cb(). This is no more
done as for listener just after the handshake has completed but just after
it has been confirmed.

src/quic_conn.c
src/quic_ssl.c

index c565c37131ae2ce0b69ddbe4ac00db2d178cfa8e..dc4f1691f27c8bd610b27072ea23db02cd87c5c7 100644 (file)
@@ -840,6 +840,10 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
                qc_set_timer(qc);
                qc_el_rx_pkts_del(qc->hel);
                qc_release_pktns_frms(qc, qc->hel->pktns);
+               if (!qc_is_listener(qc)) {
+                       /* I/O callback switch */
+                       qc->wait_event.tasklet->process = quic_conn_app_io_cb;
+               }
        }
 
        if (qc_is_listener(qc) && st >= QUIC_HS_ST_COMPLETE) {
@@ -1297,8 +1301,7 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4,
        qc->max_ack_delay = 0;
        /* Only one path at this time (multipath not supported) */
        qc->path = &qc->paths[0];
-       quic_cc_path_init(qc->path, ipv4,
-                         server ? l->bind_conf->max_cwnd : 0,
+       quic_cc_path_init(qc->path, ipv4, server ? l->bind_conf->max_cwnd : 0,
                          cc_algo ? cc_algo : default_quic_cc_algo, qc);
 
        if (local_addr)
index 2521f4bfd935c9f16486359c3b9f5fcc9b81c3c7..69e24905ec1216124718fceeed11e9eae2e72084 100644 (file)
@@ -932,10 +932,10 @@ static int qc_ssl_provide_quic_data(struct ncbuf *ncbuf,
                        goto leave;
                }
 
-               /* I/O callback switch */
-               qc->wait_event.tasklet->process = quic_conn_app_io_cb;
                qc->flags |= QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS;
                if (qc_is_listener(ctx->qc)) {
+                       /* I/O callback switch */
+                       qc->wait_event.tasklet->process = quic_conn_app_io_cb;
                        qc->state = QUIC_HS_ST_CONFIRMED;
 
                        if (!(qc->flags & QUIC_FL_CONN_ACCEPT_REGISTERED)) {