]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: define close handler
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Sep 2021 09:14:37 +0000 (11:14 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
src/xprt_quic.c

index 826538c6134afe7780e454ac14b7df9fd024df5c..d1bfea8c1a83d9e84f5644c0a76de4a25b0f4575 100644 (file)
@@ -2888,6 +2888,13 @@ static void quic_conn_free(struct quic_conn *conn)
        pool_free(pool_head_quic_conn, conn);
 }
 
+void quic_close(struct connection *conn, void *xprt_ctx)
+{
+       struct ssl_sock_ctx *conn_ctx = xprt_ctx;
+       struct quic_conn *qc = conn_ctx->conn->qc;
+       quic_conn_free(qc);
+}
+
 /* Callback called upon loss detection and PTO timer expirations. */
 static struct task *process_timer(struct task *task, void *ctx, unsigned int state)
 {
@@ -4557,6 +4564,7 @@ static int qc_xprt_start(struct connection *conn, void *ctx)
 
 /* transport-layer operations for QUIC connections. */
 static struct xprt_ops ssl_quic = {
+       .close    = quic_close,
        .snd_buf  = quic_conn_from_buf,
        .rcv_buf  = quic_conn_to_buf,
        .subscribe = quic_conn_subscribe,