]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stats: fix ctx->field update in stats_dump_proxy_to_buffer()
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 3 Feb 2023 10:43:05 +0000 (11:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Feb 2023 06:53:03 +0000 (07:53 +0100)
commit9b07d4fecd9451ad1e373c6c52c0547885c29920
tree4b570ac9851f7242e4f060c4a2cf3a5453778811
parente5958d0292222c6cc122b1b19b79c959ec27370b
BUG/MINOR: stats: fix ctx->field update in stats_dump_proxy_to_buffer()

When ctx->field was introduced with ("MINOR: stats: introduce stats field ctx")
a mistake was made for the STAT_PX_ST_LI state in stats_dump_proxy_to_buffer():

current_field reset is placed after the for loop, ie: after multiple lines
are dumped. Instead it should be placed right after each li line is dumped.

This could cause some output inconsistencies (missing fields), especially when
http dump is used with JSON output and "socket-stats" option is enabled
on the proxy, because when htx is full we restore the ctx->field with
current_field (which contains outdated value in this case).

This should be backported with ("MINOR: stats: introduce stats field ctx")
src/stats.c