unset environment variables that will break testbed, indentation and comment typo...
authorChristian Grothoff <christian@grothoff.org>
Wed, 27 Dec 2017 13:06:10 +0000 (14:06 +0100)
committerChristian Grothoff <christian@grothoff.org>
Wed, 27 Dec 2017 13:26:55 +0000 (14:26 +0100)
src/testbed/gnunet-daemon-testbed-underlay.c
src/testbed/gnunet-service-testbed_oc.c
src/testbed/gnunet-testbed-profiler.c

index 0b6c44710a89751c5b76e37f0e48530827a21217..3605e03842c385bf7c0a7be61453f99e313ca27b 100644 (file)
@@ -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;
 }
 
index 09849797c04c617e3c9271308089c81db5044da7..11c45a0f5ded2cfb59ac49e01a2366b092242aae 100644 (file)
@@ -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);
index 9829bbf0d85f1a5da0465a4a9f9d821c29a42468..0fa6d8172f1b530485d560c056a3d7687ab3f5fb 100644 (file)
@@ -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;