static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ die_task = GNUNET_SCHEDULER_NO_TASK;
if (NULL != gns_handle)
{
GNUNET_GNS_disconnect(gns_handle);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
+static void shutdown_task (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_GNS_disconnect(gns_handle);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n");
+ GNUNET_SCHEDULER_shutdown ();
+}
+
static void
on_lookup_result(void *cls, uint32_t rd_count,
const struct GNUNET_NAMESTORE_RecordData *rd)
die_task = GNUNET_SCHEDULER_NO_TASK;
}
-
GNUNET_NAMESTORE_disconnect (namestore_handle);
+ namestore_handle = NULL;
if (rd_count == 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
}
}
}
-
- GNUNET_GNS_disconnect(gns_handle);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n");
- GNUNET_SCHEDULER_shutdown ();
+
+ GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
/**
* Function scheduled to be run on the successful start of services
char* pos;
struct GNUNET_CRYPTO_ShortHashAsciiEncoded hash_str;
-
gns_handle = GNUNET_GNS_connect(cfg);
-
if (NULL == gns_handle)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,