diff options
author | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-11-04 01:00:45 +0000 |
---|---|---|
committer | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-11-04 01:00:45 +0000 |
commit | 935c1a99af43284cd89ea486213ed8fd5bed85df (patch) | |
tree | 60179e3b4e870050ce0fe035279e59481609013b | |
parent | c3f3e11150f8d1dd3a5fb0c2fdbba90b4eb3b43e (diff) |
Fixed error handling
git-svn-id: https://gnunet.org/svn/gnunet@17975 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/testing/testing_peergroup.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index 1102218f01..470fdf8faf 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c @@ -559,10 +559,12 @@ internal_hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); /* Set up task in case topology creation doesn't finish * within a reasonable amount of time */ + GNUNET_free_non_null (pg_start_ctx->fail_reason); + pg_start_ctx->fail_reason = GNUNET_strdup ("from create_topology"); pg_start_ctx->die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (pg_start_ctx->timeout), &end_badly, - "from create_topology"); + pg_start_ctx); pg_start_ctx->peers_left = pg_start_ctx->total; /* Reset counter */ create_expected_connections = GNUNET_TESTING_create_topology (pg_start_ctx->pg, @@ -579,17 +581,22 @@ internal_hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, else { GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); + GNUNET_free_non_null (pg_start_ctx->fail_reason); + pg_start_ctx->fail_reason = + GNUNET_strdup ("from create topology (bad return)"); pg_start_ctx->die_task = - GNUNET_SCHEDULER_add_now (&end_badly, - "from create topology (bad return)"); + GNUNET_SCHEDULER_add_now (&end_badly, pg_start_ctx); return; } GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); + GNUNET_free_non_null (pg_start_ctx->fail_reason); + pg_start_ctx->fail_reason = + GNUNET_strdup ("from continue startup (timeout)"); pg_start_ctx->die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (pg_start_ctx->timeout), &end_badly, - "from continue startup (timeout)"); + pg_start_ctx); } } |