From 7fc69b202a73ef1541f8991e77243385f5562d00 Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Tue, 16 Jan 2024 10:30:13 +0100 Subject: [PATCH] MINOR: quic-be: I/O handler switch adaptation 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 | 7 +++++-- src/quic_ssl.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index b23b433f9..16e155d7d 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -836,6 +836,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) { @@ -1284,8 +1288,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) diff --git a/src/quic_ssl.c b/src/quic_ssl.c index c806189f6..c129add4f 100644 --- a/src/quic_ssl.c +++ b/src/quic_ssl.c @@ -955,10 +955,10 @@ static int qc_ssl_provide_quic_data(struct ncbuf *ncbuf, qc->mux_state = QC_MUX_READY; } - /* 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)) {