From: Amaury Denoyelle Date: Wed, 12 Jan 2022 13:54:23 +0000 (+0100) Subject: MINOR: quic: free xprt tasklet on its thread X-Git-Tag: v2.6-dev1~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ab2fb39215243ad33362ddc82309a0494867cf7;p=thirdparty%2Fhaproxy.git MINOR: quic: free xprt tasklet on its thread Free the ssl_sock_ctx tasklet in quic_close() instead of quic_conn_drop(). This ensures that the tasklet is destroyed safely by the same thread. This has no impact as the free operation was previously conducted with care and should not be responsible of any crash. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 514a9517e3..07dcbd72e4 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -3328,12 +3328,8 @@ static void quic_conn_drop(struct quic_conn *qc) HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qc->li->rx.cids_lock); conn_ctx = HA_ATOMIC_LOAD(&qc->xprt_ctx); - if (conn_ctx) { - tasklet_free(conn_ctx->wait_event.tasklet); - conn_ctx->wait_event.tasklet = NULL; - + if (conn_ctx) pool_free(pool_head_quic_conn_ctx, conn_ctx); - } for (i = 0; i < QUIC_TLS_ENC_LEVEL_MAX; i++) quic_conn_enc_level_uninit(&qc->els[i]); @@ -3355,6 +3351,11 @@ void quic_close(struct connection *conn, void *xprt_ctx) qc->timer_task = NULL; } + if (conn_ctx->wait_event.tasklet) { + tasklet_free(conn_ctx->wait_event.tasklet); + conn_ctx->wait_event.tasklet = NULL; + } + quic_conn_drop(qc); TRACE_LEAVE(QUIC_EV_CONN_CLOSE, qc); }