Clients with zweo queries should not be returned unless ?withzero=true is set

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2023-11-23 10:27:58 +01:00
parent 70a34e26c5
commit ff37972f81
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
1 changed files with 4 additions and 4 deletions

View File

@ -366,18 +366,18 @@ int api_stats_top_clients(struct ftl_conn *api)
continue;
// Skip this client if there is a filter on it
bool skip_domain = false;
bool skip_client = false;
for(unsigned int j = 0; j < excludeClients; j++)
{
cJSON *item = cJSON_GetArrayItem(config.webserver.api.excludeClients.v.json, j);
if(strcmp(getstr(client->ippos), item->valuestring) == 0 ||
strcmp(getstr(client->namepos), item->valuestring) == 0)
{
skip_domain = true;
skip_client = true;
break;
}
}
if(skip_domain)
if(skip_client)
continue;
// Hidden client, probably due to privacy level. Skip this in the top lists
@ -391,7 +391,7 @@ int api_stats_top_clients(struct ftl_conn *api)
// Return this client if either
// - "withzero" option is set, and/or
// - the client made at least one query within the most recent 24 hours
if(includezeroclients || count > 0)
if(includezeroclients || client_count > 0)
{
cJSON *client_item = JSON_NEW_OBJECT();
JSON_REF_STR_IN_OBJECT(client_item, "name", client_name);