[Openvas-commits] r5577 - in trunk/openvas-client: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 16 14:22:31 CEST 2009


Author: felix
Date: 2009-10-16 14:22:30 +0200 (Fri, 16 Oct 2009)
New Revision: 5577

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/src/omp-cli.c
Log:
* src/omp-cli.c (print_tasks): Adjusted to differing OMP response for
the get_status command (one task-uuid vs many or none).


Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-10-16 11:49:44 UTC (rev 5576)
+++ trunk/openvas-client/ChangeLog	2009-10-16 12:22:30 UTC (rev 5577)
@@ -1,3 +1,8 @@
+2009-10-16  Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
+	* src/omp-cli.c (print_tasks): Adjusted to differing OMP response for
+	the get_status command (one task-uuid vs many or none).
+
 2009-10-16  Matthew Mundell <matthew.mundell at intevation.de>
 
 	More organisation and renaming, after negotiations with Felix.

Modified: trunk/openvas-client/src/omp-cli.c
===================================================================
--- trunk/openvas-client/src/omp-cli.c	2009-10-16 11:49:44 UTC (rev 5576)
+++ trunk/openvas-client/src/omp-cli.c	2009-10-16 12:22:30 UTC (rev 5577)
@@ -145,6 +145,7 @@
       if (strcmp (entity_name (task), "task") == 0)
         {
           entity_t entity;
+          entity_t last_report_entity;
           const char *id, *name, *status, *progress, *last_report_id;
 
           id = entity_attribute (task, "id");
@@ -178,7 +179,18 @@
             }
           progress = entity_text (entity);
 
-          entity = entity_child (task, "last_report");
+          /* OMP responses differ when all reports where queried vs when just a
+           * single report was queried. Try to find out by looking at the
+           * response. */
+          last_report_entity = entity_child (task, "last_report");
+          if (last_report_entity != NULL)
+            {
+              entity = last_report_entity;
+            }
+          else if (entity_child (task, "report") != NULL)
+            {
+              entity = task;
+            }
           if (entity == NULL)
             last_report_id = "";
           else



More information about the Openvas-commits mailing list