BUG/MINOR: mux-quic: prevent a crash in session_free on mux.destroy

Implement qc_destroy. This callback is used to quickly release all MUX
resources.

session_free uses this callback. Currently, it can only be called if
there was an error during connection initialization. If not defined, the
process crashes.
This commit is contained in:
Amaury Denoyelle 2022-04-13 16:54:52 +02:00
parent 67df95a8a2
commit 2461bd534a
1 changed files with 10 additions and 0 deletions

View File

@ -1057,6 +1057,15 @@ static int qc_init(struct connection *conn, struct proxy *prx,
return -1;
}
static void qc_destroy(void *ctx)
{
struct qcc *qcc = ctx;
TRACE_ENTER(QMUX_EV_QCC_END, qcc->conn);
qc_release(qcc);
TRACE_LEAVE(QMUX_EV_QCC_END);
}
static void qc_detach(struct conn_stream *cs)
{
struct qcs *qcs = __cs_mux(cs);
@ -1346,6 +1355,7 @@ INITCALL0(STG_INIT, qmux_init_stdout_traces);
static const struct mux_ops qc_ops = {
.init = qc_init,
.destroy = qc_destroy,
.detach = qc_detach,
.rcv_buf = qc_rcv_buf,
.snd_buf = qc_snd_buf,