/**
* How long do we give the peers for content migration?
*/
-#define MIGRATION_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
+#define MIGRATION_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90)
#define SEED 42
static struct GNUNET_TIME_Absolute start_time;
+static struct GNUNET_FS_TEST_ConnectContext *cc;
+
static void
do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_TIME_Relative del;
char *fancy;
+ if (NULL != cc)
+ {
+ GNUNET_FS_TEST_daemons_connect_cancel (cc);
+ cc = NULL;
+ }
GNUNET_FS_TEST_daemons_stop (2, daemons);
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
fancy =
GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) *
1000LL / del.rel_value);
- fprintf (stdout, "Download speed was %s/s\n", fancy);
+ FPRINTF (stdout, "Download speed was %s/s\n", fancy);
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
(unsigned long long) FILESIZE);
static void
do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ cc = NULL;
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
GNUNET_FS_TEST_daemons_stop (2, daemons);
{
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
- fprintf (stderr, "Daemons failed to start!\n");
+ FPRINTF (stderr, "%s", "Daemons failed to start!\n");
GNUNET_break (0);
ok = 1;
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Daemons started, will now try to connect them\n");
- GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish,
- NULL);
+ cc = GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT,
+ &do_publish, NULL);
}