From c6d70a5d3f33218447d1adc2110c79f1d24a3a0a Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 14 Feb 2019 22:40:12 +0100 Subject: [PATCH 1/4] In get_tasks do not send second_last_report. --- src/gmp.c | 55 +++---------------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index 84aba913e..7748edfe9 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -18628,7 +18628,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) char *task_scanner_uuid, *task_scanner_name; gchar *task_scanner_name_escaped; gchar *first_report, *last_report; - gchar *second_last_report_id, *second_last_report; + gchar *second_last_report_id; gchar *current_report; report_t running_report; schedule_t schedule; @@ -18910,9 +18910,6 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) second_last_report_id = task_second_last_report_id (index); if (second_last_report_id && (get_tasks_data->get.trash == 0)) { - gchar *timestamp; - char *scan_start, *scan_end; - /* If the first report is the second last report then skip * doing the count again. */ if (((first_report_id == NULL) @@ -18926,51 +18923,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) g_error ("%s: GET_TASKS: error getting counts for" " second report, aborting", __FUNCTION__); - - if (report_timestamp (second_last_report_id, ×tamp)) - g_error ("%s: GET_TASKS: error getting timestamp of" - " second report, aborting", - __FUNCTION__); - - scan_start = scan_start_time_uuid (second_last_report_id); - scan_end = scan_end_time_uuid (second_last_report_id); - - second_last_report = g_strdup_printf - ("" - "" - "%s" - "%s" - "%s" - "" - "%i" - "%i" - "%i" - "%i" - "%i" - "" - "%i" - "" - "" - "%1.1f" - "" - "", - second_last_report_id, - timestamp, - scan_start, - scan_end, - debugs, - holes_2, - infos_2, - logs, - warnings_2, - false_positives, - severity_2); - free (scan_start); - free (scan_end); - g_free (timestamp); } - else - second_last_report = g_strdup (""); last_report_id = task_iterator_last_report (&tasks); if (get_tasks_data->get.trash && last_report_id) @@ -19236,7 +19189,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) "%s" "" "%i" - "%s%s%s%s", + "%s%s%s", get_tasks_data->get.trash ? 0 : task_alterable (index), @@ -19272,8 +19225,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) task_schedule_periods (index), current_report, first_report, - last_report, - second_last_report); + last_report); g_free (config_name); g_free (config_uuid); g_free (config_name_escaped); @@ -19284,7 +19236,6 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) g_free (current_report); g_free (first_report); g_free (last_report); - g_free (second_last_report); g_free (task_schedule_uuid); g_free (task_schedule_name); g_free (task_schedule_name_escaped); From c9f5406ce2a9da39ca38d946c23677f810661f86 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 14 Feb 2019 22:51:58 +0100 Subject: [PATCH 2/4] Drop second_last_report from GMP doc. --- src/schema_formats/XML/GMP.xml.in | 96 ------------------------------- 1 file changed, 96 deletions(-) diff --git a/src/schema_formats/XML/GMP.xml.in b/src/schema_formats/XML/GMP.xml.in index 6b0fac3c7..fce49b4bb 100644 --- a/src/schema_formats/XML/GMP.xml.in +++ b/src/schema_formats/XML/GMP.xml.in @@ -20593,7 +20593,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. current_report first_report last_report - second_last_report reports average_duration result_count @@ -21158,75 +21157,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - - second_last_report - - report - - - report - - - id - uuid - 1 - - timestamp - scan_end - result_count - severity - - - timestamp - iso_time - - - scan_end - iso_time - - - result_count - Result counts for this report - - debug - false_positive - log - info - warning - hole - - - debug - integer - - - false_positive - integer - - - log - integer - - - info - integer - - - warning - integer - - - hole - integer - - - - severity - severity - Maximum severity of the report - - - reports @@ -21524,19 +21454,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5.0 - - - Mon Feb 1 19:11:20 2010 - - 0 - 0 - 7 - 0 - 3 - - 5.0 - - @@ -21626,19 +21543,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5.0 - - - Mon Feb 1 19:11:20 2010 - - 0 - 0 - 7 - 0 - 3 - - 5.0 - - From 012255bd75ce39f13a823df1d23a132a380155c3 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 14 Feb 2019 23:16:56 +0100 Subject: [PATCH 3/4] Remove first_report from get_tasks. --- src/gmp.c | 56 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index 7748edfe9..6aab60bb2 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -18627,7 +18627,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) gchar *task_schedule_name_escaped; char *task_scanner_uuid, *task_scanner_name; gchar *task_scanner_name_escaped; - gchar *first_report, *last_report; + gchar *last_report; gchar *second_last_report_id; gchar *current_report; report_t running_report; @@ -18846,9 +18846,6 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) first_report_id = task_iterator_first_report (&tasks); if (first_report_id && (get_tasks_data->get.trash == 0)) { - gchar *timestamp; - char *scan_start, *scan_end; - // TODO Could skip this count for tasks page. if (report_counts (first_report_id, &debugs, &holes_2, &infos_2, &logs, @@ -18858,54 +18855,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) g_error ("%s: GET_TASKS: error getting counts for" " first report, aborting", __FUNCTION__); - - if (report_timestamp (first_report_id, ×tamp)) - g_error ("%s: GET_TASKS: failed to get timestamp of" - " first report, aborting", - __FUNCTION__); - - scan_start = scan_start_time_uuid (first_report_id); - scan_end = scan_end_time_uuid (first_report_id); - - first_report = g_strdup_printf ("" - "" - "" - "%s" - "" - "%s" - "%s" - "" - "%i" - "%i" - "%i" - "%i" - "%i" - "" - "%i" - "" - "" - "" - "%1.1f" - "" - "" - "", - first_report_id, - timestamp, - scan_start, - scan_end, - debugs, - holes_2, - infos_2, - logs, - warnings_2, - false_positives, - severity_2); - free (scan_start); - free (scan_end); - g_free (timestamp); } - else - first_report = g_strdup (""); second_last_report_id = task_second_last_report_id (index); if (second_last_report_id && (get_tasks_data->get.trash == 0)) @@ -19189,7 +19139,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) "%s" "" "%i" - "%s%s%s", + "%s%s", get_tasks_data->get.trash ? 0 : task_alterable (index), @@ -19224,7 +19174,6 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) schedule_available ? "" : "", task_schedule_periods (index), current_report, - first_report, last_report); g_free (config_name); g_free (config_uuid); @@ -19234,7 +19183,6 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error) g_free (task_target_name_escaped); g_free (progress_xml); g_free (current_report); - g_free (first_report); g_free (last_report); g_free (task_schedule_uuid); g_free (task_schedule_name); From f686b7c6549c02678d7815f2849b7ebd27c935e3 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 14 Feb 2019 23:26:27 +0100 Subject: [PATCH 4/4] Remove first_report from get_tasks in GMP doc. --- src/schema_formats/XML/GMP.xml.in | 96 ------------------------------- 1 file changed, 96 deletions(-) diff --git a/src/schema_formats/XML/GMP.xml.in b/src/schema_formats/XML/GMP.xml.in index fce49b4bb..2fba9bc86 100644 --- a/src/schema_formats/XML/GMP.xml.in +++ b/src/schema_formats/XML/GMP.xml.in @@ -20591,7 +20591,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. report_count trend current_report - first_report last_report reports average_duration @@ -21019,75 +21018,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - - first_report - - report - - - report - - - id - uuid - 1 - - timestamp - scan_end - result_count - severity - - - timestamp - iso_time - - - scan_end - iso_time - - - result_count - Result counts for this report - - debug - false_positive - log - info - warning - hole - - - debug - integer - - - false_positive - integer - - - log - integer - - - info - integer - - - warning - integer - - - hole - integer - - - - severity - severity - Maximum severity of the report - - - last_report @@ -21428,19 +21358,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. over - - - Mon Feb 1 19:11:20 2010 - - 0 - 0 - 7 - 0 - 3 - - 5.0 - - Mon Feb 1 19:11:20 2010 @@ -21517,19 +21434,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. over - - - Mon Feb 1 19:11:20 2010 - - 0 - 0 - 7 - 0 - 3 - - 5.0 - - Mon Feb 1 19:11:20 2010