From: Amaury Denoyelle Date: Wed, 16 Oct 2024 09:05:51 +0000 (+0200) Subject: MINOR: quic: notify connection layer on handshake completion X-Git-Tag: v3.0.7~53 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=f45ea9b8d964d2dd0fc72077d024ba54b01cd524;p=haproxy-3.0.git MINOR: quic: notify connection layer on handshake completion Wake up connection layer on QUIC handshake completion via quic_conn_io_cb. Select SUB_RETRY_RECV as this was previously unused by QUIC MUX layer. For the moment, QUIC MUX never subscribes for handshake completion. However, this will be necessary for features such as the delaying of early data forwarding via wait-for-handshake. This patch will be necessary to implement wait-for-handshake support for QUIC. As such, it must be backported with next commits up to 2.6, after a mandatory period of observation. (cherry picked from commit 5a5950e42d7060ee311e51438f4f16ad0effefd9) Signed-off-by: Christopher Faulet --- diff --git a/src/mux_quic.c b/src/mux_quic.c index bd222fd..b3ea3f7 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2588,7 +2588,8 @@ struct task *qcc_io_cb(struct task *t, void *ctx, unsigned int status) TRACE_ENTER(QMUX_EV_QCC_WAKE, qcc->conn); - qcc_io_send(qcc); + if (!(qcc->wait_event.events & SUB_RETRY_SEND)) + qcc_io_send(qcc); qcc_io_recv(qcc); diff --git a/src/quic_conn.c b/src/quic_conn.c index 2f8e0c6..2684a79 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -864,6 +864,14 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state) * TODO implement discarding of 0-RTT keys */ } + + /* Wake up connection layer if on wait-for-handshake. */ + if (qc->subs && qc->subs->events & SUB_RETRY_RECV) { + tasklet_wakeup(qc->subs->tasklet); + qc->subs->events &= ~SUB_RETRY_RECV; + if (!qc->subs->events) + qc->subs = NULL; + } } /* Insert each QEL into sending list if needed. */