]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: remove implicit static trash_chunk usage
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Apr 2024 14:13:48 +0000 (16:13 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Apr 2024 15:04:08 +0000 (17:04 +0200)
commitb3d5708adcbf106daf85ce79ba86e7289df4a793
tree7ffaf7dd91a53f467021d357e7b9be5248146f8c
parentffea2e1a135d7db6c227f46b8906aff89bb38606
MINOR: stats: remove implicit static trash_chunk usage

A static variable trash_chunk was used as implicit buffer in most of
stats output function. It was a oneline buffer uses as temporary storage
before emitting to the final applet or CLI buffer.

Replaces it by a buffer defined in show_stat_ctx structure. This allows
to retrieve it in most of stats output function. An additional parameter
was added for the function where context was not already used. This
renders the code cleaner and will allow to split stats.c in several
source files.

As a result of a new member into show_stat_ctx, per-command context max
size has increased. This forces to increase APPLET_MAX_SVCCTX to ensure
pool size is big enough. Increase it to 128 bytes which includes some
extra room for the future.
include/haproxy/applet-t.h
include/haproxy/stats-t.h
src/stats.c