Skip to content

Commit

Permalink
fix: no auth clients reports
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Sep 1, 2024
1 parent 39008dd commit c977b7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/firewall.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ get_gw_clients_counter(t_gateway_setting *gw_setting, t_client *worklist)
while (gw_setting) {
json_object *gw_obj = json_object_new_object();
json_object_object_add(gw_obj, "gw_id", json_object_new_string(gw_setting->gw_id));
json_object_object_add(gw_obj, "gw_channel", json_object_new_string(gw_setting->gw_channel));
json_object *client_array = json_object_new_array();
if (!client_array) {
debug(LOG_ERR, "Could not create json array");
Expand All @@ -539,8 +540,10 @@ get_gw_clients_counter(t_gateway_setting *gw_setting, t_client *worklist)
t_client *p1 = NULL, *p2 = NULL;
for (p1 = p2 = worklist; NULL != p1; p1 = p2) {
p2 = p1->next;
if (p1->gw_setting != gw_setting)
continue;
if (strcmp(p1->gw_setting->gw_id, gw_setting->gw_id) != 0) {
debug(LOG_DEBUG, "client %s not in gateway %s", p1->ip, gw_setting->gw_id);
continue;
}

json_object *clt = json_object_new_object();
json_object_object_add(clt, "id", json_object_new_int(p1->id));
Expand Down

0 comments on commit c977b7a

Please sign in to comment.