From: Frédéric Lécaille Date: Wed, 3 Mar 2021 16:28:34 +0000 (+0100) Subject: MINOR: quic: Add callbacks for (un)scribing to QUIC xprt. X-Git-Tag: v2.5-dev8~146 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=422a39cf2cd7bf612d34bad10425aa2a2c503953;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 2677257151..d926b8210b 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,