]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: Fix Lua's `get_stats` function
authorTim Duesterhus <tim@bastelstu.be>
Thu, 1 Jun 2023 16:58:08 +0000 (18:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Jun 2023 06:29:25 +0000 (08:29 +0200)
Lua's `get_stats` function stopped working in
4cfb0019e65bce79953164eddf54c1bbb61add62, due to the addition a new field
ST_F_PROTO without a corresponding entry in `stat_fields`.

Fix the issue by adding the entry, like
a46b142e8807ea640e041d3a29e3fd427844d559 did previously for a different field.

This patch fixes GitHub Issue #2174, it should be backported to 2.8.

src/stats.c

index 68adde6c5810e1019e13554b0ab39cfc68335a76..1d071e2c132d27ab848b2ef086d4431e20418ad7 100644 (file)
@@ -274,6 +274,7 @@ const struct name_desc stat_fields[ST_F_TOTAL_FIELDS] = {
        [ST_F_H1REQ]                         = { .name = "h1req",                       .desc = "Total number of HTTP/1 sessions processed by this object since the worker process started" },
        [ST_F_H2REQ]                         = { .name = "h2req",                       .desc = "Total number of hTTP/2 sessions processed by this object since the worker process started" },
        [ST_F_H3REQ]                         = { .name = "h3req",                       .desc = "Total number of HTTP/3 sessions processed by this object since the worker process started" },
+       [ST_F_PROTO]                         = { .name = "proto",                       .desc = "Protocol" },
 };
 
 /* one line of info */