MINOR: cache: Use dedicated trash for "show cache" cli command
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 16 Nov 2023 16:38:20 +0000 (17:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 16 Nov 2023 18:35:10 +0000 (19:35 +0100)
commita0d7c290ecef26f3b39dc84b8c0c3972207bf913
treee4ae549e1d1ca08a12cc8c15ccfad9022d652656
parent3831d8454ff99cc8438769ba3ae3fbffb9414939
MINOR: cache: Use dedicated trash for "show cache" cli command

After the latest changes in the cache/shared_context mechanism, the
cache and shared_context logic were decorrelated and in some unlikely
cases we might end up using the "show cache" command while some regular
cache processing is occurring (a response being stored in the cache for
instance). In such a case, because we used the same 'trash' buffer in
those two contexts, we could end up with the contents of a response in
the ouput of the "show cache" command.
This patch fixes this problem by allocating a dedicated trash for the
CLI command.
src/cache.c