From: Amaury Denoyelle Date: Tue, 29 Mar 2022 12:46:38 +0000 (+0200) Subject: MINOR: mux-quic: define release app-ops X-Git-Tag: v2.6-dev5~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbc13b71c69feb493c1da25d4462c468e3a13092;p=thirdparty%2Fhaproxy.git MINOR: mux-quic: define release app-ops Define a new callback release inside qcc_app_ops. It is called when the qcc MUX is freed via qc_release. This will allows to implement cleaning on the app layer. --- diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index b15b884698..20d633b5eb 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -118,6 +118,7 @@ struct qcc_app_ops { int (*decode_qcs)(struct qcs *qcs, int fin, void *ctx); size_t (*snd_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags); int (*finalize)(void *ctx); + void (*release)(void *ctx); }; #endif /* USE_QUIC */ diff --git a/src/mux_quic.c b/src/mux_quic.c index 8381a817b1..e68b362b95 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -481,6 +481,9 @@ static void qc_release(struct qcc *qcc) TRACE_DEVEL("freeing qcc", QMUX_EV_QCC_END, conn); + if (qcc->app_ops && qcc->app_ops->release) + qcc->app_ops->release(qcc->ctx); + if (qcc->wait_event.tasklet) tasklet_free(qcc->wait_event.tasklet);