]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: make HTML stats dump rely on the table for the check status
authorWilly Tarreau <w@1wt.eu>
Fri, 8 Jan 2016 08:48:26 +0000 (09:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Mar 2016 16:08:05 +0000 (17:08 +0100)
We can now check that the check status field is present to know that a
check is enabled.

src/dumpstats.c

index fce8d90a3f9cab80f320815af28ded73f7877ec9..b7b568062b5e8249ea08d81b4427447b630f91e8 100644 (file)
@@ -3946,7 +3946,7 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                        chunk_appendf(&trash, "%s ", human_time(stats[ST_F_LASTCHG].u.u32, 1));
                        chunk_appendf(&trash, srv_hlt_st[1], "GCC: your -Werror=format-security is bogus, annoying, and hides real bugs, I don't thank you, really!");
                }
-               else if (ref->check.state & CHK_ST_ENABLED) {
+               else if (stats[ST_F_CHECK_STATUS].type) {
                        chunk_appendf(&trash, "%s ", human_time(stats[ST_F_LASTCHG].u.u32, 1));
                        chunk_appendf(&trash,
                                      srv_hlt_st[state],
@@ -3976,7 +3976,7 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                        }
                        chunk_appendf(&trash, "</div></u>");
                }
-               else if ((sv->check.state & (CHK_ST_ENABLED|CHK_ST_PAUSED)) == CHK_ST_ENABLED) {
+               else if (stats[ST_F_CHECK_STATUS].type) {
                        chunk_appendf(&trash,
                                      "</td><td class=ac><u> %s",
                                      field_str(stats, ST_F_CHECK_STATUS));