/** * Task run on shutdown. * * @param cls NULL */ static void shutdown_task (void *cls) { if (NULL != set_op) { GNUNET_IDENTITY_cancel (set_op); set_op = NULL; } if (NULL != create_op) { GNUNET_IDENTITY_cancel (create_op); create_op = NULL; } if (NULL != delete_op) { GNUNET_IDENTITY_cancel (delete_op); delete_op = NULL; } GNUNET_IDENTITY_disconnect (sh); sh = NULL; }
/** * Clean up all resources used. */ static void cleanup () { if (NULL != op) { GNUNET_IDENTITY_cancel (op); op = NULL; } if (NULL != h) { GNUNET_IDENTITY_disconnect (h); h = NULL; } GNUNET_SCHEDULER_shutdown (); }
/** * Function run on shutdown. * * @param cls closure */ static void do_shutdown (void *cls) { if (NULL != timeout_task) { GNUNET_SCHEDULER_cancel (timeout_task); timeout_task = NULL; } if (NULL != op) { GNUNET_IDENTITY_cancel (op); op = NULL; } if (NULL != call1) { GNUNET_CONVERSATION_call_stop (call1); call1 = NULL; } if (NULL != call2) { GNUNET_CONVERSATION_call_stop (call2); call2 = NULL; } if (NULL != phone) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from PHONE service.\n"); GNUNET_CONVERSATION_phone_destroy (phone); phone = NULL; } if (NULL != id) { GNUNET_IDENTITY_disconnect (id); id = NULL; } if (NULL != qe) { GNUNET_NAMESTORE_cancel (qe); qe = NULL; } if (NULL != ns) { GNUNET_NAMESTORE_disconnect (ns); ns = NULL; } }
/** * Signature of the main function of a task. * * @param cls closure * @param tc context information (why was this task triggered now) */ static void end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_SCHEDULER_shutdown (); if (NULL != op) { GNUNET_IDENTITY_cancel (op); op = NULL; } if (NULL != call) { GNUNET_CONVERSATION_call_stop (call); call = NULL; } if (NULL != phone) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from PHONE service.\n"); GNUNET_CONVERSATION_phone_destroy (phone); phone = NULL; } if (NULL != id) { GNUNET_IDENTITY_disconnect (id); id = NULL; } if (NULL != qe) { GNUNET_NAMESTORE_cancel (qe); qe = NULL; } if (NULL != ns) { GNUNET_NAMESTORE_disconnect (ns); ns = NULL; } }
/** * Task run on shutdown. Cleans up everything. * * @param cls unused * @param tc scheduler context */ static void do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { if (NULL != get_default) { GNUNET_IDENTITY_cancel (get_default); get_default = NULL; } if (NULL != idh) { GNUNET_IDENTITY_disconnect (idh); idh = NULL; } if (NULL != el) { GNUNET_IDENTITY_ego_lookup_cancel (el); el = NULL; } if (NULL != list_it) { GNUNET_NAMESTORE_zone_iteration_stop (list_it); list_it = NULL; } if (NULL != add_qe) { GNUNET_NAMESTORE_cancel (add_qe); add_qe = NULL; } if (NULL != add_qe_uri) { GNUNET_NAMESTORE_cancel (add_qe_uri); add_qe_uri = NULL; } if (NULL != del_qe) { GNUNET_NAMESTORE_cancel (del_qe); del_qe = NULL; } if (NULL != ns) { GNUNET_NAMESTORE_disconnect (ns); ns = NULL; } memset (&zone_pkey, 0, sizeof (zone_pkey)); if (NULL != uri) { GNUNET_free (uri); uri = NULL; } if (NULL != zm) { GNUNET_NAMESTORE_zone_monitor_stop (zm); zm = NULL; } if (NULL != data) { GNUNET_free (data); data = NULL; } }