]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mux-quic: remove useless app_ops is_active callback
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 1 Aug 2022 09:42:48 +0000 (11:42 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 1 Aug 2022 12:13:51 +0000 (14:13 +0200)
Timeout in QUIC MUX has evolved from the simple first implementation. At
the beginning, a connection was considered dead unless bidirectional
streams were opened. This was abstracted through an app callback
is_active().

Now this paradigm has been reversed and a connection is considered alive
by default, unless an error has been reported or a timeout has already
been fired. The callback is_active() is thus not used anymore and can be
safely removed to simplify qcc_is_dead().

This commit should be backported to 2.6.

include/haproxy/mux_quic-t.h
src/h3.c
src/hq_interop.c
src/mux_quic.c

index a78609edb10f53c5cebaacab51c2052151430b21..a3aff843448e7a863341ad3317dc9c17a75db04a 100644 (file)
@@ -176,7 +176,6 @@ struct qcc_app_ops {
        size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags);
        void (*detach)(struct qcs *qcs);
        int (*finalize)(void *ctx);
-       int (*is_active)(const struct qcc *qcc, void *ctx);
        void (*release)(void *ctx);
        void (*inc_err_cnt)(void *ctx, int err_code);
 };
index d75c7d04c58403fafa34d7a1fee1b1f2b4dcfe44..bda99cd2c6700e7372786df744323f065343cb35 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1192,18 +1192,6 @@ static void h3_release(void *ctx)
        pool_free(pool_head_h3c, h3c);
 }
 
-/* Check if the H3 connection can still be considered as active.
- *
- * Return true if active else false.
- */
-static int h3_is_active(const struct qcc *qcc, void *ctx)
-{
-       if (qcc->strms[QCS_CLT_BIDI].nb_streams)
-               return 1;
-
-       return 0;
-}
-
 /* Increment the h3 error code counters for <error_code> value */
 static void h3_stats_inc_err_cnt(void *ctx, int err_code)
 {
@@ -1238,7 +1226,6 @@ const struct qcc_app_ops h3_ops = {
        .snd_buf     = h3_snd_buf,
        .detach      = h3_detach,
        .finalize    = h3_finalize,
-       .is_active   = h3_is_active,
        .release     = h3_release,
        .inc_err_cnt = h3_stats_inc_err_cnt,
 };
index 5000a7e2ef716b3b404cd941a5bc7a447bf7dd36..f2933d6b5747aee886076a168592cda444179ce1 100644 (file)
@@ -164,16 +164,7 @@ static size_t hq_interop_snd_buf(struct stconn *sc, struct buffer *buf,
        return total;
 }
 
-static int hq_is_active(const struct qcc *qcc, void *ctx)
-{
-       if (!eb_is_empty(&qcc->streams_by_id))
-               return 1;
-
-       return 0;
-}
-
 const struct qcc_app_ops hq_interop_ops = {
        .decode_qcs = hq_interop_decode_qcs,
        .snd_buf    = hq_interop_snd_buf,
-       .is_active  = hq_is_active,
 };
index 5580d46fb16798ab4944f81df2985b95061f5929..65d62a4aa815353bdabc3165fa4d54325058a863 100644 (file)
@@ -1001,10 +1001,6 @@ static void qcs_destroy(struct qcs *qcs)
 
 static inline int qcc_is_dead(const struct qcc *qcc)
 {
-       if (qcc->app_ops && qcc->app_ops->is_active &&
-           qcc->app_ops->is_active(qcc, qcc->ctx))
-               return 0;
-
        if ((qcc->conn->flags & CO_FL_ERROR) || !qcc->task)
                return 1;