#include "gnunet_program_lib.h"
#include "gnunet_scheduler_lib.h"
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
#define START_ARM GNUNET_YES
};
+static void
+shutdown_task (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_CORE_disconnect (p1.ch);
+ p1.ch = NULL;
+ GNUNET_CORE_disconnect (p2.ch);
+ p2.ch = NULL;
+ ok = 0;
+}
+
+
+
static void
init_notify (void *cls,
else
{
GNUNET_assert (cls == &p2);
- GNUNET_CORE_disconnect (p1.ch);
- GNUNET_CORE_disconnect (p2.ch);
GNUNET_SCHEDULER_cancel (timeout_task_id);
- ok = 0;
+ GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
}
OKPP;
setup_peer (&p1, "test_core_api_peer1.conf");
setup_peer (&p2, "test_core_api_peer2.conf");
- timeout_task_id = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ timeout_task_id = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
&timeout_task,
NULL);
p1.ch = GNUNET_CORE_connect (p1.cfg, 1,