]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: fix lastchk metric that got accidently lost
authorWilly Tarreau <w@1wt.eu>
Wed, 12 May 2021 15:29:14 +0000 (17:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 May 2021 15:50:16 +0000 (17:50 +0200)
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 <metric> 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

index 1218cb53f9c997d1d8846f00dfd822f04ddae234..1f2a6849521fd6a9727edeb10d8554bb849bfe7d 100644 (file)
@@ -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: