From 973a937c5f0bf479037cea60594538aa1fde5fb6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 12 May 2021 17:29:14 +0200 Subject: [PATCH] BUG/MINOR: stats: fix lastchk metric that got accidently lost Commit d3a9a4992 ("MEDIUM: stats: allow to select one field in `stats_fill_sv_stats`") left one occurrence of a direct assignment of stats[] instead of placing it into the variable, and it was on ST_F_CHECK_STATUS. This resulted in the field being overwritten with an empty one immediately after being set in stats_fill_sv_stats() and the field to appear empty on the stats page. No backport is needed as this was only for 2.4. --- src/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats.c b/src/stats.c index 1218cb53f..1f2a68495 100644 --- a/src/stats.c +++ b/src/stats.c @@ -2299,7 +2299,7 @@ int stats_fill_sv_stats(struct proxy *px, struct server *sv, int flags, chunk_strcat(out, get_check_status_info(sv->check.status)); if (!(sv->check.state & CHK_ST_INPROGRESS)) fld_chksts += 2; // skip "* " - stats[ST_F_CHECK_STATUS] = mkf_str(FN_OUTPUT, fld_chksts); + metric = mkf_str(FN_OUTPUT, fld_chksts); } break; case ST_F_CHECK_CODE: