[Openvas-commits] r5646 - in trunk/openvas-libraries: . omp

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 20 13:58:55 CEST 2009


Author: felix
Date: 2009-10-20 13:58:53 +0200 (Tue, 20 Oct 2009)
New Revision: 5646

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/omp/omp.c
Log:
Fixed some FIXMEs about response checking.

* omp/omp.c (omp_delete_report, omp_modify_task, omp_modify_task_file):
Added response checking.

* ChangeLog: Fixed last entry.


Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2009-10-20 11:53:27 UTC (rev 5645)
+++ trunk/openvas-libraries/ChangeLog	2009-10-20 11:58:53 UTC (rev 5646)
@@ -1,8 +1,15 @@
 2009-10-20  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
-	Use check_response where response entities have no (interesting) content,
-	avoid duplicate code.
+	Fixed some FIXMEs about response checking.
 
+	* omp/omp.c (omp_delete_report, omp_modify_task, omp_modify_task_file):
+	Added response checking.
+
+2009-10-20  Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
+	Use check_response where response entities have no (interesting)
+	content, avoid duplicate code.
+
 	* omp/omp.c (omp_delete_task, omp_create_target, omp_delete_target)
 	(omp_create_config, omp_delete_config, omp_create_lsc_credential)
 	(omp_delete_lsc_credential): Call check_response instead of checking

Modified: trunk/openvas-libraries/omp/omp.c
===================================================================
--- trunk/openvas-libraries/omp/omp.c	2009-10-20 11:53:27 UTC (rev 5645)
+++ trunk/openvas-libraries/omp/omp.c	2009-10-20 11:58:53 UTC (rev 5646)
@@ -1155,18 +1155,10 @@
 int
 omp_delete_report (gnutls_session_t* session, const char* id)
 {
-  entity_t response;
-
   if (openvas_server_sendf (session, "<delete_report report_id=\"%s\"/>", id))
     return -1;
 
-  response = NULL;
-  if (read_entity (session, &response)) return -1;
-
-  // FIX check status
-
-  free_entity (response);
-  return 0;
+  return check_response (session);
 }
 
 /**
@@ -1184,8 +1176,6 @@
 omp_modify_task (gnutls_session_t* session, const char* id,
                  const char* rcfile, const char* name, const char* comment)
 {
-  entity_t response;
-
   if (openvas_server_sendf (session, "<modify_task task_id=\"%s\">", id))
     return -1;
 
@@ -1218,13 +1208,7 @@
   if (openvas_server_send (session, "</modify_task>"))
     return -1;
 
-  response = NULL;
-  if (read_entity (session, &response)) return -1;
-
-  // FIX check status
-
-  free_entity (response);
-  return 0;
+  return check_response (session);
 }
 
 /**
@@ -1243,8 +1227,6 @@
                       const char* name, const void* content,
                       gsize content_len)
 {
-  entity_t response;
-
   if (name == NULL) return -1;
 
   if (openvas_server_sendf (session, "<modify_task task_id=\"%s\">", id))
@@ -1282,13 +1264,7 @@
   if (openvas_server_send (session, "</modify_task>"))
     return -1;
 
-  response = NULL;
-  if (read_entity (session, &response)) return -1;
-
-  // FIX check status
-
-  free_entity (response);
-  return 0;
+  return check_response (session);
 }
 
 /**



More information about the Openvas-commits mailing list