]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cache: fix cache tree iteration
authorMaxime Henrion <mhenrion@haproxy.com>
Fri, 29 May 2026 15:55:39 +0000 (11:55 -0400)
committerOlivier Houchard <cognet@ci0.org>
Fri, 29 May 2026 15:16:03 +0000 (17:16 +0200)
Ever since the introduction of multiple cache trees, the "show cache"
CLI command was not properly showing the contents of each tree, but was
only showing the first one.
Fix that by properly resetting next_key when we switch to the next tree.

Should be backported up to 3.0.

src/cache.c

index 8349bdd173d675968fad4bd2e1be81caf2a98871..f6055cc502ab92fb670cb4dac54b7e0125c40ce8 100644 (file)
@@ -3047,6 +3047,7 @@ static int cli_io_handler_show_cache(struct appctx *appctx)
                                node = eb32_lookup_ge(&cache_tree->entries, next_key);
                                if (!node) {
                                        ctx->next_key = 0;
+                                       next_key = 0;
                                        break;
                                }