From 422a39cf2cd7bf612d34bad10425aa2a2c503953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 3 Mar 2021 17:28:34 +0100 Subject: [PATCH] MINOR: quic: Add callbacks for (un)scribing to QUIC xprt. Add these callbacks so that the QUIC mux may (un)scribe to the read/write xprt events. --- src/xprt_quic.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 267725715..d926b8210 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -4277,6 +4277,25 @@ static size_t quic_conn_from_buf(struct connection *conn, void *xprt_ctx, const return done; } +/* Called from the upper layer, to subscribe to events . The + * event subscriber is not allowed to change from a previous call as long + * as at least one event is still subscribed. The must only be a + * combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0. + */ +static int quic_conn_subscribe(struct connection *conn, void *xprt_ctx, int event_type, struct wait_event *es) +{ + return conn_subscribe(conn, xprt_ctx, event_type, es); +} + +/* Called from the upper layer, to unsubscribe from events . + * The pointer is not allowed to differ from the one passed to the + * subscribe() call. It always returns zero. + */ +static int quic_conn_unsubscribe(struct connection *conn, void *xprt_ctx, int event_type, struct wait_event *es) +{ + return conn_unsubscribe(conn, xprt_ctx, event_type, es); +} + /* Initialize a QUIC connection (quic_conn struct) to be attached to * connection with as address of the xprt context. * Returns 1 if succeeded, 0 if not. @@ -4403,6 +4422,8 @@ static int qc_conn_init(struct connection *conn, void **xprt_ctx) static struct xprt_ops ssl_quic = { .snd_buf = quic_conn_from_buf, .rcv_buf = quic_conn_to_buf, + .subscribe = quic_conn_subscribe, + .unsubscribe = quic_conn_unsubscribe, .init = qc_conn_init, .prepare_bind_conf = ssl_sock_prepare_bind_conf, .destroy_bind_conf = ssl_sock_destroy_bind_conf,