]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stats: update the trash chunk where it's used
authorWilly Tarreau <w@1wt.eu>
Wed, 17 May 2023 06:43:15 +0000 (08:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 May 2023 07:33:54 +0000 (09:33 +0200)
When integrating the number of warnings in "show info" in 2.8 with commit
3c4a297d2 ("MINOR: stats: report the total number of warnings issued"),
the update of the trash buffer used by the Tainted flag got displaced
lower. There's no harm for now util someone adds a new metric requiring
a call to chunk_newstr() and gets both values merged. Let's move the
call to its location now.

src/stats.c

index c06fce3d30ccfe60b0c8d03245df3e06b8e63977..48eb532e09d1bd84d1cb922dd652f2dbb581d921 100644 (file)
@@ -4745,9 +4745,9 @@ int stats_fill_info(struct field *info, int len, uint flags)
        info[INF_CUM_LOG_MSGS]                   = mkf_u32(FN_COUNTER, cum_log_messages);
 
        info[INF_TAINTED]                        = mkf_str(FO_STATUS, chunk_newstr(out));
+       chunk_appendf(out, "%#x", get_tainted());
        info[INF_WARNINGS]                       = mkf_u32(FN_COUNTER, HA_ATOMIC_LOAD(&tot_warnings));
        info[INF_MAXCONN_REACHED]                = mkf_u32(FN_COUNTER, HA_ATOMIC_LOAD(&maxconn_reached));
-       chunk_appendf(out, "%#x", get_tainted());
 
        return 1;
 }