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.
This commit is contained in:
Amaury Denoyelle 2022-01-12 14:54:23 +01:00
parent b76ae69513
commit 9ab2fb3921

View File

@ -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);
}