From: Christian Grothoff Date: Mon, 19 Sep 2011 20:01:22 +0000 (+0000) Subject: print emsg X-Git-Tag: initial-import-from-subversion-38251~17009 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b27c6973972c465848761c016968b7b7d522bd40;p=oweals%2Fgnunet.git print emsg --- diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index f318f9722..fc1560996 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c @@ -129,9 +129,15 @@ end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_SCHEDULER_cancel (curr_get_ctx.retry_task); } + static void end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { + const char *emsg = cls; + + fprintf (stderr, + "Error: %s\n", + emsg); if (curr_get_ctx.retry_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (curr_get_ctx.retry_task); @@ -144,6 +150,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ok = 1; } + /* Forward declaration */ static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); @@ -279,7 +286,7 @@ do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -void +static void topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, const struct GNUNET_PeerIdentity *second, uint32_t distance, const struct GNUNET_CONFIGURATION_Handle *first_cfg, @@ -316,7 +323,8 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, #endif GNUNET_SCHEDULER_cancel (die_task); die_task = - GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from test gets"); + GNUNET_SCHEDULER_add_delayed (TIMEOUT, + &end_badly, "Timeout trying to GET"); curr_get_ctx.dht_handle = peer1dht; curr_get_ctx.peer = &peer2id; @@ -333,6 +341,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, } } + static void connect_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { @@ -354,6 +363,7 @@ connect_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) "from connect topology (timeout)"); } + static void peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_CONFIGURATION_Handle *cfg, @@ -361,8 +371,9 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, { if (emsg != NULL) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Failed to start daemon with error: `%s'\n", emsg); + fprintf (stderr, + "Failed to start daemon: `%s'\n", + emsg); return; } GNUNET_assert (id != NULL); @@ -410,6 +421,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, } } + static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)