BUG/MINOR: cache: Fix loop on cache entries in "show cache"
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 23 Nov 2021 15:03:05 +0000 (16:03 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 23 Nov 2021 15:25:29 +0000 (16:25 +0100)
commitdd1cdd9f4d62456478d324610044154633553f54
tree18e53c9a4a8796e37e3e1be3c33df5cd325e07f6
parentf2e0833f16aa8c09e1c7001ff55aac4f13c643b7
BUG/MINOR: cache: Fix loop on cache entries in "show cache"

A regression was introduced in the commit da91842b6 ("BUG/MEDIUM: cache/cli:
make "show cache" thread-safe"). When cli_io_handler_show_cache() is called,
only one node is retrieved and is used to fill the output buffer in loop.
Once set, the "node" variable is never renewed. At the end, all nodes are
dumped but each one is duplicated several time into the output buffer.

This patch must be backported everywhere the above commit is. It means only
to 2.5 and 2.4.

(cherry picked from commit 27f88a9059d0e343d82a0319b622e0f4248b0bb8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cache.c