]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: define release app-ops
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 29 Mar 2022 12:46:38 +0000 (14:46 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 30 Mar 2022 14:12:18 +0000 (16:12 +0200)
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.

include/haproxy/mux_quic-t.h
src/mux_quic.c

index b15b884698555cf68a47cd131551e528cd6020fe..20d633b5eb614b3499def4b5b1ce5e471b86a863 100644 (file)
@@ -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 */
index 8381a817b1fc93e0befcc44b5a01c3b24655d6c1..e68b362b95036465101668ce6a10baf42852ec5d 100644 (file)
@@ -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);