mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-10-30 01:42:22 +00:00
Fixed missing statistics updating for unknown mapping keys in collectd/influxd.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -1074,6 +1074,8 @@ static ssize_t collectd_map_index(char const * const json_key,
|
|||||||
struct global_map const * const map,
|
struct global_map const * const map,
|
||||||
size_t map_length)
|
size_t map_length)
|
||||||
{
|
{
|
||||||
|
ssize_t unknown_key = -1;
|
||||||
|
|
||||||
if (json_key == NULL || key_length == 0)
|
if (json_key == NULL || key_length == 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1083,6 +1085,7 @@ static ssize_t collectd_map_index(char const * const json_key,
|
|||||||
{
|
{
|
||||||
if (map[i].json_key == NULL)
|
if (map[i].json_key == NULL)
|
||||||
{
|
{
|
||||||
|
unknown_key = i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1092,7 +1095,7 @@ static ssize_t collectd_map_index(char const * const json_key,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return unknown_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int collectd_map_flow_u8(struct nDPIsrvd_socket * const sock,
|
static int collectd_map_flow_u8(struct nDPIsrvd_socket * const sock,
|
||||||
|
|||||||
@@ -946,6 +946,8 @@ static ssize_t influxd_map_index(char const * const json_key,
|
|||||||
struct global_map const * const map,
|
struct global_map const * const map,
|
||||||
size_t map_length)
|
size_t map_length)
|
||||||
{
|
{
|
||||||
|
ssize_t unknown_key = -1;
|
||||||
|
|
||||||
if (json_key == NULL || key_length == 0)
|
if (json_key == NULL || key_length == 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@@ -955,6 +957,7 @@ static ssize_t influxd_map_index(char const * const json_key,
|
|||||||
{
|
{
|
||||||
if (map[i].json_key == NULL)
|
if (map[i].json_key == NULL)
|
||||||
{
|
{
|
||||||
|
unknown_key = i;
|
||||||
continue;
|
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,
|
static int influxd_map_flow_u8(struct nDPIsrvd_socket * const sock,
|
||||||
|
|||||||
Reference in New Issue
Block a user