]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cli/stats: add missing trailing LF after "show info json"
authorWilly Tarreau <w@1wt.eu>
Fri, 10 Jun 2022 13:12:21 +0000 (15:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Jun 2022 13:12:21 +0000 (15:12 +0200)
commitc6b7a97e5465e0d220ff5555cd88bab7bc5e4f5c
tree16b10c27fd8de25603dc34bd6763bbb7ac45f751
parent9b46fb4cca9ab673be8d1cdce6876a4abaa7918e
BUG/MINOR: cli/stats: add missing trailing LF after "show info json"

This is the continuation of commit 5a0e7ca5d ("BUG/MINOR: cli/stats: add
missing trailing LF after JSON outputs"). There's also a "show info json"
command which was also missing the trailing LF. It's constructed exactly
like the "show stat json", in that it dumps a series of fields without any
LF. The difference however is that for the stats output, everything was
enclosed in an array which required an LF *after* the closing bracket,
while here there's no such array so we have to emit the LF after the loop.
That makes the two functions a bit inconsistent, it's quite annoying, but
making them better would require sending one LF per line in the stats
output, which is not particularly interesting.

Given that it took 5+ years to spot that this code wasn't working as
expected it doesn't seem worth investing much time trying to refactor
it to make it look cleaner at the risk of breaking other obscure parts.
src/stats.c