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);
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);
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])
/**
- * 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);
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++)
{
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);
}
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);
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);
}
_("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);
}
{
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);