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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/stats.c b/src/stats.c
index 68adde6c5..1d071e2c1 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -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 */
-- 
2.40.1


Reply via email to