]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: remove qcc_shutdown() from qcc_release()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 18 Dec 2023 16:30:35 +0000 (17:30 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 Dec 2023 14:27:11 +0000 (15:27 +0100)
Render qcc_release() more generic by removing qcc_shutdown(). This
prevents systematic graceful shutdown/CONNECTION_CLOSE emission if only
QCC resource deallocation is necessary.

For now, qcc_shutdown() is used before every qcc_release() invocation.
The only exception is on qmux_destroy stream layer callback.

This commit will be useful to reuse qcc_release() in other contexts to
simply deallocate a QCC instance.

src/mux_quic.c

index 541c68715916e45c6003dafd5c67747720629efe..f276d7776a34d81941ed49ee777010c21ebd9c28 100644 (file)
@@ -2387,9 +2387,7 @@ static int qcc_io_process(struct qcc *qcc)
        return 0;
 }
 
-/* release function. This one should be called to free all resources allocated
- * to the mux.
- */
+/* Free all resources allocated for <qcc> connection. */
 static void qcc_release(struct qcc *qcc)
 {
        struct connection *conn = qcc->conn;
@@ -2397,8 +2395,6 @@ static void qcc_release(struct qcc *qcc)
 
        TRACE_ENTER(QMUX_EV_QCC_END, conn);
 
-       qcc_shutdown(qcc);
-
        if (qcc->task) {
                task_destroy(qcc->task);
                qcc->task = NULL;
@@ -2471,6 +2467,7 @@ struct task *qcc_io_cb(struct task *t, void *ctx, unsigned int status)
        return NULL;
 
  release:
+       qcc_shutdown(qcc);
        qcc_release(qcc);
        TRACE_LEAVE(QMUX_EV_QCC_WAKE);
        return NULL;
@@ -2513,6 +2510,7 @@ static struct task *qcc_timeout_task(struct task *t, void *ctx, unsigned int sta
         */
        if (qcc_is_dead(qcc)) {
                TRACE_STATE("releasing dead connection", QMUX_EV_QCC_WAKE, qcc->conn);
+               qcc_shutdown(qcc);
                qcc_release(qcc);
        }
 
@@ -2710,6 +2708,7 @@ static void qmux_strm_detach(struct sedesc *sd)
        return;
 
  release:
+       qcc_shutdown(qcc);
        qcc_release(qcc);
        TRACE_LEAVE(QMUX_EV_STRM_END);
        return;
@@ -2967,6 +2966,7 @@ static int qmux_wake(struct connection *conn)
        return 0;
 
  release:
+       qcc_shutdown(qcc);
        qcc_release(qcc);
        TRACE_LEAVE(QMUX_EV_QCC_WAKE);
        return 1;