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 ();
+}
+
/**
* Called when gns shorten finishes
*/
die_task = GNUNET_SCHEDULER_NO_TASK;
}
- if (NULL != gns_handle)
- {
- GNUNET_GNS_disconnect(gns_handle);
- gns_handle = NULL;
- }
-
if (NULL != dht_handle)
{
GNUNET_DHT_disconnect (dht_handle);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shorten test succeeded!\n");
}
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n");
- GNUNET_SCHEDULER_shutdown ();
+ GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}