From 4c23b5d1b3ffba73a0e94a0d852538deea23c986 Mon Sep 17 00:00:00 2001 From: ozgen Date: Wed, 4 Jun 2025 15:02:46 +0200 Subject: [PATCH] Change: Revert openvasd scan progress calculation --- openvasd/openvasd.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/openvasd/openvasd.c b/openvasd/openvasd.c index 941b533c3..0faed0b69 100644 --- a/openvasd/openvasd.c +++ b/openvasd/openvasd.c @@ -1006,26 +1006,7 @@ openvasd_get_scan_progress_ext (openvasd_connector_t conn, cJSON *host = scanning->child; while (host) { - int finished_tests, total_tests, single_host_progress; - - if (!cJSON_IsObject (host)) - { - progress = 0; - goto cleanup; - } - - finished_tests = get_member_value_or_fail (host, "finished_tests"); - total_tests = get_member_value_or_fail (host, "total_tests"); - - if (total_tests <= 0 || finished_tests < 0) - { - progress = 0; - goto cleanup; - } - - single_host_progress = (100 * finished_tests / total_tests); - - running_hosts_progress_sum += single_host_progress; + running_hosts_progress_sum += cJSON_GetNumberValue (host); host = host->next; } }