]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: notify connection layer on handshake completion
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 16 Oct 2024 09:05:51 +0000 (11:05 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 16 Oct 2024 09:42:06 +0000 (11:42 +0200)
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.

src/mux_quic.c
src/quic_conn.c

index 13b058e071958417d48753dbaac84f1c355530a9..e87b97e4727373cdf652166ad60e027cf5864914 100644 (file)
@@ -2701,7 +2701,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);
 
index 37eaf940b20289b908c25b817230cce70b60d65c..9701eaab2e03926b5b78a49eef5035920f9e0866 100644 (file)
@@ -861,6 +861,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. */