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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 13 22:30:06 CEST 2009


Author: mattm
Date: 2009-10-13 22:30:05 +0200 (Tue, 13 Oct 2009)
New Revision: 5522

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/openvas/monitor_dialog.c
Log:
	* openvas/monitor_dialog.c (monitor_stop_whole_test) [USE_OMP]: Add OMP
	alternative.

Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-10-13 20:29:33 UTC (rev 5521)
+++ trunk/openvas-client/ChangeLog	2009-10-13 20:30:05 UTC (rev 5522)
@@ -1,5 +1,10 @@
 2009-10-13  Matthew Mundell <matthew.mundell at intevation.de>
 
+	* openvas/monitor_dialog.c (monitor_stop_whole_test) [USE_OMP]: Add OMP
+	alternative.
+
+2009-10-13  Matthew Mundell <matthew.mundell at intevation.de>
+
 	* openvas/prefs_dialog/prefs_scope_tree.c
 	(scopetree_add_new_with_parent) [USE_OMP]: Add missing format specifier.
 

Modified: trunk/openvas-client/openvas/monitor_dialog.c
===================================================================
--- trunk/openvas-client/openvas/monitor_dialog.c	2009-10-13 20:29:33 UTC (rev 5521)
+++ trunk/openvas-client/openvas/monitor_dialog.c	2009-10-13 20:30:05 UTC (rev 5522)
@@ -676,28 +676,48 @@
 
  context = arg_get_value(ctrls, "CONTEXT");
 
- network_printf(context->socket, "CLIENT <|> STOP_WHOLE_TEST <|> CLIENT\n");
- gtk_idle_remove(GPOINTER_TO_SIZE(arg_get_value(ctrls, "TAG")));
+#ifdef USE_OMP
+ if (context->protocol == PROTOCOL_OMP)
+   {
+     if (omp_abort_task (&context->session,
+                         prefs_get_string (context, "id")))
+       show_error(_("%s: omp_abort_task failed"), __FUNCTION__);
+     else
+       refresh_reports (context);
+   }
+ else
+#endif /* USE_OMP */
+   {
+     network_printf(context->socket, "CLIENT <|> STOP_WHOLE_TEST <|> CLIENT\n");
+     gtk_idle_remove(GPOINTER_TO_SIZE(arg_get_value(ctrls, "TAG")));
 
- /*
-  * Read the data remaining...
-  */
- while(type != MSG_BYE)
- {
-  buf[sizeof(buf) - 1] = '\0';
-  network_gets_raw(context->socket, buf, sizeof(buf) - 1);
-   if( buf[0] == '\0') {
-  	break;
-	}
-  if ((n = strlen (buf)) && buf [n-1] == '\n') buf [n-1] = '\0';
-  msg  = emalloc(strlen(buf)+1);
-  type = parse_server_message(context, buf, GPOINTER_TO_SIZE(arg_get_value(ctrls, "MONITOR_BACKEND")), msg);
-  efree(&msg);
- }
+     /*
+      * Read the data remaining...
+      */
+     while(type != MSG_BYE)
+     {
+      buf[sizeof(buf) - 1] = '\0';
+      network_gets_raw(context->socket, buf, sizeof(buf) - 1);
+       if( buf[0] == '\0') {
+            break;
+            }
+      if ((n = strlen (buf)) && buf [n-1] == '\n') buf [n-1] = '\0';
+      msg  = emalloc(strlen(buf)+1);
+      type = parse_server_message(context,
+                                  buf,
+                                  GPOINTER_TO_SIZE(arg_get_value(ctrls,
+                                                                 "MONITOR_BACKEND")),
+                                  msg);
+      efree(&msg);
+     }
+   }
 
  context->action = CONTEXT_IDLE;
  prefs_context_update(context);
  gtk_widget_hide(arg_get_value(ctrls, "WINDOW"));
+#ifdef USE_OMP
+ if (context->protocol == PROTOCOL_OTP)
+#endif
  report_save(context, GPOINTER_TO_SIZE(arg_get_value(ctrls, "MONITOR_BACKEND")), NULL);
  return(FALSE);
 }



More information about the Openvas-commits mailing list