From 111cae2400240d06ba454de7744e115cdc82b15c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 27 Dec 2017 14:06:10 +0100 Subject: [PATCH] unset environment variables that will break testbed, indentation and comment typo fixes --- src/testbed/gnunet-daemon-testbed-underlay.c | 6 ++++-- src/testbed/gnunet-service-testbed_oc.c | 15 ++++++++++----- src/testbed/gnunet-testbed-profiler.c | 15 ++++++++------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c index 0b6c44710..3605e0384 100644 --- a/src/testbed/gnunet-daemon-testbed-underlay.c +++ b/src/testbed/gnunet-daemon-testbed-underlay.c @@ -165,7 +165,8 @@ check_access (void *cls, const struct GNUNET_PeerIdentity * pid) static int -get_identity (unsigned int offset, struct GNUNET_PeerIdentity *id) +get_identity (unsigned int offset, + struct GNUNET_PeerIdentity *id) { struct GNUNET_CRYPTO_EddsaPrivateKey private_key; @@ -174,7 +175,8 @@ get_identity (unsigned int offset, struct GNUNET_PeerIdentity *id) GNUNET_memcpy (&private_key, hostkeys_data + (offset * GNUNET_TESTING_HOSTKEYFILESIZE), GNUNET_TESTING_HOSTKEYFILESIZE); - GNUNET_CRYPTO_eddsa_key_get_public (&private_key, &id->public_key); + GNUNET_CRYPTO_eddsa_key_get_public (&private_key, + &id->public_key); return GNUNET_OK; } diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index 09849797c..11c45a0f5 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c @@ -261,7 +261,7 @@ struct OverlayConnectContext enum OverlayConnectContextType type; /** - * The id of the second peer which is has to connect to the first peer + * The id of the second peer which has to connect to the first peer */ uint32_t other_peer_id; }; @@ -930,10 +930,10 @@ send_hello (void *cls) other_peer_str); GNUNET_free (other_peer_str); lp2c->ohh = - GNUNET_TRANSPORT_offer_hello (lp2c->tcc.cfg, - occ->hello, - &occ_hello_sent_cb, - occ); + GNUNET_TRANSPORT_offer_hello (lp2c->tcc.cfg, + occ->hello, + &occ_hello_sent_cb, + occ); if (NULL == lp2c->ohh) { GNUNET_break (0); @@ -1001,6 +1001,11 @@ p2_transport_connect (struct OverlayConnectContext *occ) { struct Peer *peer2; + /* HUH? Why to *obtain* HELLO? Seems we use this to *SEND* the + HELLO! */ + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Connecting to transport of peer %s to obtain HELLO\n", + GNUNET_i2s (&occ->other_peer_identity)); GNUNET_assert (NULL == occ->emsg); GNUNET_assert (NULL != occ->hello); GNUNET_assert (NULL == occ->ghh); diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 9829bbf0d..0fa6d8172 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c @@ -175,9 +175,7 @@ controller_event_cb (void *cls, { printf ("\nAborting due to very high failure rate\n"); print_overlay_links_summary (); - if (NULL != abort_task) - GNUNET_SCHEDULER_cancel (abort_task); - abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); + GNUNET_SCHEDULER_shutdown (); return; } } @@ -260,11 +258,12 @@ run (void *cls, char *const *args, const char *cfgfile, event_mask = 0; event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); - GNUNET_TESTBED_run (hosts_file, cfg, num_peers, event_mask, controller_event_cb, - NULL, &test_run, NULL); + GNUNET_TESTBED_run (hosts_file, cfg, num_peers, event_mask, + &controller_event_cb, NULL, + &test_run, NULL); abort_task = - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_abort, - NULL); + GNUNET_SCHEDULER_add_shutdown (&do_abort, + NULL); } @@ -310,6 +309,8 @@ main (int argc, char *const *argv) const char *binaryHelp = "gnunet-testbed-profiler [OPTIONS]"; int ret; + unsetenv ("XDG_DATA_HOME"); + unsetenv ("XDG_CONFIG_HOME"); if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; result = GNUNET_SYSERR; -- 2.25.1