diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2024-02-18 23:16:31 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2024-02-20 23:16:31 +0100 |
commit | 717d66b0e7a05eb0d22c85fda7a4448885e7f1ec (patch) | |
tree | cb82321b2f69214bd5e080bb57ff703d0f6b464b /examples/c-influxd/c-influxd.c | |
parent | 791b27219dc4f7680c072a601558af3977a30bbd (diff) |
Fixed missing statistics updating for unknown mapping keys in collectd/influxd.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-influxd/c-influxd.c')
-rw-r--r-- | examples/c-influxd/c-influxd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/c-influxd/c-influxd.c b/examples/c-influxd/c-influxd.c index ed6f2e99e..c58c36ae3 100644 --- a/examples/c-influxd/c-influxd.c +++ b/examples/c-influxd/c-influxd.c @@ -946,6 +946,8 @@ static ssize_t influxd_map_index(char const * const json_key, struct global_map const * const map, size_t map_length) { + ssize_t unknown_key = -1; + if (json_key == NULL || key_length == 0) { return -1; @@ -955,6 +957,7 @@ static ssize_t influxd_map_index(char const * const json_key, { if (map[i].json_key == NULL) { + unknown_key = i; continue; } @@ -964,7 +967,7 @@ static ssize_t influxd_map_index(char const * const json_key, } } - return -1; + return unknown_key; } static int influxd_map_flow_u8(struct nDPIsrvd_socket * const sock, |