From: Maxime Henrion Date: Tue, 23 Dec 2025 15:57:22 +0000 (-0500) Subject: CLEANUP: patterns: remove dead code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99e625a41dd673af59eddc006246096ea56f204e;p=thirdparty%2Fhaproxy.git CLEANUP: patterns: remove dead code 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. --- diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index b30f37319..c6267f3ca 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -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); diff --git a/src/map.c b/src/map.c index cd9d7a350..df972b48e 100644 --- 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",