removed GNUNET_TESTBED_operation_cancel
authorSree Harsha Totakura <totakura@in.tum.de>
Fri, 26 Oct 2012 12:58:46 +0000 (12:58 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Fri, 26 Oct 2012 12:58:46 +0000 (12:58 +0000)
src/fs/fs_test_lib.c
src/gns/test_gns_dht_three_peers.c
src/include/gnunet_testbed_service.h
src/mesh/gnunet-regex-profiler.c
src/testbed/gnunet-service-testbed.c
src/testbed/gnunet-testbed-profiler.c
src/testbed/testbed_api_testbed.c
src/testbed/testbed_api_topology.c

index 3345519641e63312f1bc9f7b8c7e2b8be4e7262d..4323bc66d2f36608619730285e30853cf13d4804 100644 (file)
@@ -212,7 +212,7 @@ publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               "Timeout while trying to publish data\n");
   if (NULL == po->fs)
-    GNUNET_TESTBED_operation_cancel (po->fs_op);
+    GNUNET_TESTBED_operation_done (po->fs_op);
   else
     GNUNET_TESTBED_operation_done (po->fs_op);
   GNUNET_FS_publish_stop (po->publish_context);
@@ -486,7 +486,7 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                      dop->download_cont_cls,
                                      GNUNET_SCHEDULER_REASON_TIMEOUT);
   if (NULL == dop->fs)
-    GNUNET_TESTBED_operation_cancel (dop->fs_op);
+    GNUNET_TESTBED_operation_done (dop->fs_op);
   else
     GNUNET_TESTBED_operation_done (dop->fs_op);
   GNUNET_FS_uri_destroy (dop->uri);
index 7f501231142173e7b4acbe538124acca9bfd03bd..a7bad9bbac6b1709d604f396219b508d6a2be00c 100644 (file)
@@ -107,12 +107,12 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
     if (NULL != get_cfg_ops[c])
     {
-        GNUNET_TESTBED_operation_cancel(get_cfg_ops[c]);
+        GNUNET_TESTBED_operation_done(get_cfg_ops[c]);
         get_cfg_ops[c] = NULL;
     }
     if (NULL != connect_ops[c])
     {
-        GNUNET_TESTBED_operation_cancel(connect_ops[c]);
+        GNUNET_TESTBED_operation_done(connect_ops[c]);
         connect_ops[c] = NULL;
     }
     if (NULL != cfg_handles[c])
index f4c02fbad1bf33b352f5fd78f2febc85456f2ca6..c2c6812f4990b7e6ebf5c11dee7f86740c93bf65 100644 (file)
@@ -1188,26 +1188,25 @@ GNUNET_TESTBED_service_connect (void *op_cls,
 
 
 /**
- * Cancel a pending operation.  Releases all resources
- * of the operation and will ensure that no event
- * is generated for the operation.  Does NOT guarantee
- * that the operation will be fully undone (or that
- * nothing ever happened).
+ * This function is used to signal that the event information (struct
+ * GNUNET_TESTBED_EventInformation) from an operation has been fully processed
+ * i.e. if the event callback is ever called for this operation. If the event
+ * callback for this operation has not yet been called, calling this function
+ * cancels the operation, frees its resources and ensures the no event is
+ * generated with respect to this operation. Note that however cancelling an
+ * operation does NOT guarantee that the operation will be fully undone (or that
+ * nothing ever happened). 
  *
- * @param operation operation to cancel
- */
-void
-GNUNET_TESTBED_operation_cancel (struct GNUNET_TESTBED_Operation *operation);
-
-
-/**
- * Signal that the information from an operation has been fully
- * processed.  This function MUST be called for each event
- * of type 'operation_finished' to fully remove the operation
- * from the operation queue.  After calling this function, the
- * 'op_result' becomes invalid (!).
+ * This function MUST be called for every operation to fully remove the
+ * operation from the operation queue.  After calling this function, if
+ * operation is completed and its event information is of type
+ * GNUNET_TESTBED_ET_OPERATION_FINISHED, the 'op_result' becomes invalid (!).
+
+ * If the operation is generated from GNUNET_TESTBED_service_connect() then
+ * calling this function on such as operation calls the disconnect adapter if
+ * the connect adapter was ever called.
  *
- * @param operation operation to signal completion for
+ * @param operation operation to signal completion or cancellation
  */
 void
 GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation);
index e6178eac621bae9086225693b6370ef629329371..6228423325c2c83ecdff28f26b373f7ce51dc9c2 100644 (file)
@@ -395,9 +395,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++)
   {
     if (NULL != peers[peer_cnt].mesh_op_handle)
-      GNUNET_TESTBED_operation_cancel (peers[peer_cnt].mesh_op_handle);
+      GNUNET_TESTBED_operation_done (peers[peer_cnt].mesh_op_handle);
     if (NULL != peers[peer_cnt].stats_op_handle)
-      GNUNET_TESTBED_operation_cancel (peers[peer_cnt].stats_op_handle);
+      GNUNET_TESTBED_operation_done (peers[peer_cnt].stats_op_handle);
   }
   for (search_str_cnt = 0; search_str_cnt < num_search_strings; search_str_cnt++)
   {
@@ -411,14 +411,14 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   if (NULL != reg_handle)
     GNUNET_TESTBED_cancel_registration (reg_handle);
   if (NULL != topology_op)
-    GNUNET_TESTBED_operation_cancel (topology_op);
+    GNUNET_TESTBED_operation_done (topology_op);
   for (nhost = 0; nhost < num_hosts; nhost++)
     if (NULL != hosts[nhost])
       GNUNET_TESTBED_host_destroy (hosts[nhost]);
   GNUNET_free_non_null (hosts);
   while (NULL != (dll_op = dll_op_head))
   {
-    GNUNET_TESTBED_operation_cancel (dll_op->op);
+    GNUNET_TESTBED_operation_done (dll_op->op);
     GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op);
     GNUNET_free (dll_op);
   }
index 81cf29c5ff2ec24275c4b4fcc183b87fb532f0c6..1ece6c6bbb5b766fb8b4d628327a3ef1eef602a4 100644 (file)
@@ -3672,7 +3672,7 @@ reghost_free_iterator (void *cls,
     cleanup_focc (focc);
   }
   if (NULL != rhc->sub_op)
-    GNUNET_TESTBED_operation_cancel (rhc->sub_op);
+    GNUNET_TESTBED_operation_done (rhc->sub_op);
   if (NULL != rhc->client)
   GNUNET_SERVER_client_drop (rhc->client);
   GNUNET_free (value);
index 4168408e94346999c91094b9129e3b8168f1604f..0d9143a863df1ce1a908b2a51243860e70580fe2 100644 (file)
@@ -258,14 +258,14 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   if (NULL != reg_handle)
     GNUNET_TESTBED_cancel_registration (reg_handle);
   if (NULL != topology_op)
-    GNUNET_TESTBED_operation_cancel (topology_op);
+    GNUNET_TESTBED_operation_done (topology_op);
   for (nhost = 0; nhost < num_hosts; nhost++)
     if (NULL != hosts[nhost])
       GNUNET_TESTBED_host_destroy (hosts[nhost]);
   GNUNET_free_non_null (hosts);
   while (NULL != (dll_op = dll_op_head))
   {
-    GNUNET_TESTBED_operation_cancel (dll_op->op);
+    GNUNET_TESTBED_operation_done (dll_op->op);
     GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op);
     GNUNET_free (dll_op);
   }
index 02b20d2145873377de23cf84c1ac17a7303111d0..96ac22c2bd94cf32610c359de2e33fe8ba4addd5 100644 (file)
@@ -271,7 +271,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
          _("Some operations are still pending. Cancelling them\n"));
     while (NULL != (dll_op = rc->dll_op_head))
     {
-      GNUNET_TESTBED_operation_cancel (dll_op->op);
+      GNUNET_TESTBED_operation_done (dll_op->op);
       GNUNET_CONTAINER_DLL_remove (rc->dll_op_head, rc->dll_op_tail, dll_op);
       GNUNET_free (dll_op);
     }
index 84202ec8c1249440d795959b7596dea845274671..edf0f5d3f40ead2b8963ba3ec467631c4268e370 100644 (file)
@@ -177,7 +177,7 @@ oprelease_overlay_configure_topology (void *cls)
   {
     for (p = 0; p < tc->link_array_size; p++)
       if (NULL != tc->link_array[p].op)
-        GNUNET_TESTBED_operation_cancel (tc->link_array[p].op);
+        GNUNET_TESTBED_operation_done (tc->link_array[p].op);
     GNUNET_free (tc->link_array);
   }
   GNUNET_free (tc);