]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: patterns: remove dead code
authorMaxime Henrion <mhenrion@haproxy.com>
Tue, 23 Dec 2025 15:57:22 +0000 (10:57 -0500)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Dec 2025 20:17:39 +0000 (21:17 +0100)
Situations where we are iterating over elements and find one with a
different generation ID cannot arise anymore since the elements are kept
per-generation.

src/hlua_fcn.c
src/map.c

index b30f3731933cdffbb6763f2c31eeec0d147cfaff..c6267f3ca2a944fd73861dbef5d80ac64ae11181 100644 (file)
@@ -3047,7 +3047,6 @@ static int _hlua_listable_patref_pairs_iterator(lua_State *L, int status, lua_KC
        int context_index;
        struct hlua_patref_iterator_context *hctx;
        struct pat_ref_elt *elt;
-       int cnt = 0;
        unsigned int curr_gen;
 
        context_index = lua_upvalueindex(1);
@@ -3078,23 +3077,6 @@ static int _hlua_listable_patref_pairs_iterator(lua_State *L, int status, lua_KC
 
        elt = LIST_ELEM(hctx->bref.ref, struct pat_ref_elt *, list);
 
-       if (elt->gen_id != curr_gen) {
-               /* check if we may do something to try to prevent thread contention,
-                * unless we run from body/init state where hlua_yieldk is no-op
-                */
-               if (cnt > 10000 && hlua_gethlua(L)) {
-                       /* let's yield and wait for being called again to continue where we left off */
-                       LIST_APPEND(&elt->back_refs, &hctx->bref.users);
-                       HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &hctx->ref->ptr->lock);
-                       hlua_yieldk(L, 0, 0, _hlua_listable_patref_pairs_iterator, TICK_ETERNITY, HLUA_CTRLYIELD); // continue
-                       return 0; // not reached
-               }
-
-               hctx->bref.ref = elt->list.n;
-               cnt++;
-               goto next;
-       }
-
        LIST_APPEND(&elt->back_refs, &hctx->bref.users);
        HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &hctx->ref->ptr->lock);
 
index cd9d7a3505601f50b2bffe2b20eec23ce74b63d3..df972b48ee4eaec6c44000a89e3390f994400f43 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -402,9 +402,6 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
 
                        elt = LIST_ELEM(ctx->bref.ref, struct pat_ref_elt *, list);
 
-                       if (elt->gen_id != ctx->curr_gen)
-                               goto skip;
-
                        /* build messages */
                        if (elt->sample)
                                chunk_appendf(&trash, "%p %s %s\n",