*/
static struct GNUNET_SCHEDULER_Task *timeout;
+/**
+ * Cleanup task
+ */
+static struct GNUNET_SCHEDULER_Task *cleanup_task;
+
static void
do_cleanup(void *cls)
{
+ cleanup_task = NULL;
if (NULL != timeout)
GNUNET_SCHEDULER_cancel (timeout);
if (NULL != reclaim_op)
ticket_str);
GNUNET_free (ticket_str);
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%s\n", emsg);
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
if (NULL == identity)
{
reclaim_op = NULL;
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
return;
}
if (NULL == attr)
attr_iterator = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to iterate over attributes\n");
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
ret = 1;
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Timeout\n");
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ if (NULL == cleanup_task)
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
"Revocation failed.\n");
ret = 1;
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
attr_iterator = NULL;
if (list)
{
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
return;
}
NULL);
return;
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
}
static void
-ego_iter_finished (void *cls)
+start_get_attributes ()
{
if (NULL == pkey)
{
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Ego %s not found\n", ego_name);
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
return;
}
if (NULL == name) {
if (GNUNET_YES == init) {
init = GNUNET_NO;
- GNUNET_SCHEDULER_add_now (&ego_iter_finished, NULL);
+ start_get_attributes();
}
return;
}