gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -minor bugfixes, adding FIXMEs


From: gnunet
Subject: [gnunet] branch master updated: -minor bugfixes, adding FIXMEs
Date: Tue, 15 Aug 2023 21:42:59 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new ecfbd79c0 -minor bugfixes, adding FIXMEs
ecfbd79c0 is described below

commit ecfbd79c029090dfbc657194adae2d229273fb9d
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Tue Aug 15 21:41:31 2023 +0200

    -minor bugfixes, adding FIXMEs
---
 src/include/gnunet_testing_netjail_lib.h           |   4 +-
 src/include/gnunet_testing_ng_lib.h                |  19 +-
 src/testing/gnunet-cmds-helper.c                   | 243 +++++++++++----------
 src/testing/testing_api_cmd_barrier.c              |   3 +
 src/testing/testing_api_cmd_barrier_reached.c      |  12 +-
 .../testing_api_cmd_block_until_external_trigger.c |   1 +
 .../testing_api_cmd_netjail_start_cmds_helper.c    |  26 +--
 src/testing/testing_api_cmd_send_peer_ready.c      |   3 +-
 src/testing/testing_api_loop.c                     |  38 ++--
 src/transport/gnunet-communicator-quic.c           |   6 +-
 src/transport/gnunet-communicator-tcp.c            |  12 +-
 src/transport/gnunet-communicator-udp.c            |   4 +-
 src/transport/gnunet-service-tng.c                 |  28 +--
 src/transport/plugin_transport_http_common.c       |   2 +-
 src/transport/plugin_transport_wlan.c              |   3 +-
 src/transport/test_communicator_basic.c            |   6 +-
 src/transport/test_transport_api2.c                |   2 +-
 src/transport/test_transport_plugin_cmd_nat_upnp.c |  10 +-
 .../test_transport_plugin_cmd_simple_send.c        |   8 +-
 ...st_transport_plugin_cmd_simple_send_broadcast.c |  17 +-
 .../test_transport_plugin_cmd_simple_send_dv.c     |  18 +-
 .../test_transport_plugin_cmd_udp_backchannel.c    |   2 +
 src/transport/test_transport_start_with_config.c   |  12 +-
 src/transport/transport-testing2.c                 |   1 +
 .../transport_api_cmd_backchannel_check.c          |   1 +
 src/transport/transport_api_cmd_connecting_peers.c |  21 +-
 src/transport/transport_api_cmd_start_peer.c       |   2 +-
 27 files changed, 275 insertions(+), 229 deletions(-)

diff --git a/src/include/gnunet_testing_netjail_lib.h 
b/src/include/gnunet_testing_netjail_lib.h
index 106d7cdae..1d6f114eb 100644
--- a/src/include/gnunet_testing_netjail_lib.h
+++ b/src/include/gnunet_testing_netjail_lib.h
@@ -515,10 +515,10 @@ GNUNET_TESTING_cmd_local_test_prepared (const char *label,
  */
 #define GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS(op) \
   op (test_system, const struct GNUNET_TESTING_System) \
-  op (async_context, const struct GNUNET_TESTING_AsyncContext) \
+  op (async_context, struct GNUNET_TESTING_AsyncContext) \
   op (helper_handles, const struct GNUNET_HELPER_Handle *) \
   op (local_prepared_state, const struct GNUNET_TESTING_LocalPreparedState) \
-  op (block_state, const struct GNUNET_TESTING_BlockState)
+  op (block_state, struct GNUNET_TESTING_BlockState)
 
 GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT)
 
diff --git a/src/include/gnunet_testing_ng_lib.h 
b/src/include/gnunet_testing_ng_lib.h
index 71d352643..5c9079fdf 100644
--- a/src/include/gnunet_testing_ng_lib.h
+++ b/src/include/gnunet_testing_ng_lib.h
@@ -70,7 +70,7 @@ struct GNUNET_TESTING_AsyncContext
   /**
    * Interpreter we are part of.
    */
-  struct GNUNET_TESTING_Interpreter *is;
+  struct GNUNET_TESTING_Interpreter *is; // Why needed? When available?
 
   /**
    * Function to call when done.
@@ -90,14 +90,17 @@ struct GNUNET_TESTING_AsyncContext
   enum GNUNET_GenericReturnValue finished;
 };
 
+
 typedef void
 (*GNUNET_TESTING_CommandRunRoutine)(void *cls,
                                     struct GNUNET_TESTING_Interpreter *is);
 
+
 typedef void
 (*GNUNET_TESTING_CommandCleanupRoutine)(void *cls);
 
-typedef  enum GNUNET_GenericReturnValue
+
+typedef enum GNUNET_GenericReturnValue
 (*GNUNET_TESTING_CommandGetTraits) (void *cls,
                                     const void **ret,
                                     const char *trait,
@@ -240,6 +243,7 @@ struct GNUNET_TESTING_Command
  * @param label label of the command to lookup.
  * @return the command, if it is found, or NULL.
  */
+// FIXME: think harder about whether this is actually needed, likely not.
 const struct GNUNET_TESTING_Command *
 GNUNET_TESTING_interpreter_lookup_future_command (
   struct GNUNET_TESTING_Interpreter *is,
@@ -321,10 +325,13 @@ GNUNET_TESTING_cmd_end (void);
 
 
 /**
- * Turn asynchronous command into non blocking command by setting 
asynchronous_finish to true.
- * FIXME: what is this API doing? Is it returning a new cmd which is 
unblocking?
- * Is it modifying cmd?
- * Looking at the code, it both modifying cmd AND returning a copy oO
+ * Turn asynchronous command into non blocking command by setting
+ * asynchronous_finish to true.  Modifies (and then returns) @a cmd simply
+ * setting the bit. By default, most commands are blocking, and by wrapping
+ * the command construction in this function a blocking command can be turned
+ * into an asynchronous command where the interpreter continues after
+ * initiating the asynchronous action. Does nothing if the command is
+ * fundamentally synchronous.
  *
  * @param cmd command to make synchronous.
  * @return a finish-command.
diff --git a/src/testing/gnunet-cmds-helper.c b/src/testing/gnunet-cmds-helper.c
index de50aca3a..4428d4402 100644
--- a/src/testing/gnunet-cmds-helper.c
+++ b/src/testing/gnunet-cmds-helper.c
@@ -69,8 +69,8 @@
  * if the start script was not started from within a new namespace
  * created by unshare. The UPNP test case needs public IP
  * addresse for miniupnpd to function.
- * FIXME We should introduce a switch indicating if public 
- * addresses should be used or not. This info has to be 
+ * FIXME We should introduce a switch indicating if public
+ * addresses should be used or not. This info has to be
  * propagated from the start script to the c code.
 #define KNOWN_BASE_IP "172.16.151."
 
@@ -276,7 +276,8 @@ write_task (void *cls)
  *
  */
 static void
-write_message (struct GNUNET_MessageHeader *message, size_t msg_length)
+write_message (struct GNUNET_MessageHeader *message,
+               size_t msg_length)
 {
   struct WriteContext *wc;
 
@@ -292,6 +293,7 @@ write_message (struct GNUNET_MessageHeader *message, size_t 
msg_length)
     wc);
 }
 
+
 static void
 delay_shutdown_cb ()
 {
@@ -333,11 +335,11 @@ finished_cb (enum GNUNET_GenericReturnValue rv)
   write_message ((struct GNUNET_MessageHeader *) reply, msg_length);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "message send\n");
-
+  // FIXME: bad hack, do not write 1s, have continuation after write_message() 
is done!
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "delaying shutdown\n");
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
-                                delay_shutdown_cb,
+                                &delay_shutdown_cb,
                                 NULL);
 }
 
@@ -354,10 +356,10 @@ finished_cb (enum GNUNET_GenericReturnValue rv)
  *    #GNUNET_NO to stop further processing (no error)
  *    #GNUNET_SYSERR to stop further processing with error
  */
-static int
-tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message)
+static enum GNUNET_GenericReturnValue
+tokenizer_cb (void *cls,
+              const struct GNUNET_MessageHeader *message)
 {
-
   struct NodeIdentifier *ni = cls;
   const struct GNUNET_TESTING_CommandHelperInit *msg;
   struct GNUNET_TESTING_CommandHelperReply *reply;
@@ -377,114 +379,130 @@ tokenizer_cb (void *cls, const struct 
GNUNET_MessageHeader *message)
        "Received message type %u and size %u\n",
        type,
        msize);
-  if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT == ntohs (message->type))
+  switch (type)
   {
-    msg = (const struct GNUNET_TESTING_CommandHelperInit *) message;
-    plugin_name_size = ntohs (msg->plugin_name_size);
-    if ((sizeof(struct GNUNET_TESTING_CommandHelperInit) + plugin_name_size) > 
msize)
+  case GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT:
     {
-      GNUNET_break (0);
-      LOG (GNUNET_ERROR_TYPE_WARNING,
-           "Received unexpected message -- exiting\n");
-      goto error;
+      msg = (const struct GNUNET_TESTING_CommandHelperInit *) message;
+      plugin_name_size = ntohs (msg->plugin_name_size);
+      if ((sizeof(struct GNUNET_TESTING_CommandHelperInit) + plugin_name_size) 
>
+          msize)
+      {
+        GNUNET_break (0);
+        LOG (GNUNET_ERROR_TYPE_WARNING,
+             "Received unexpected message -- exiting\n");
+        goto error;
+      }
+      plugin_name = GNUNET_malloc (plugin_name_size + 1);
+      GNUNET_strlcpy (plugin_name,
+                      ((char *) &msg[1]),
+                      plugin_name_size + 1);
+
+      binary = GNUNET_OS_get_libexec_binary_path ("gnunet-cmd");
+
+      plugin = GNUNET_new (struct TestcasePlugin);
+      plugin->api = GNUNET_PLUGIN_load (plugin_name,
+                                        NULL);
+      plugin->library_name = GNUNET_strdup (basename (plugin_name));
+
+      plugin->global_n = ni->global_n;
+      plugin->local_m = ni->local_m;
+      plugin->n = ni->n;
+      plugin->m = ni->m;
+
+      GNUNET_asprintf (&router_ip,
+                       ROUTER_BASE_IP "%s",
+                       plugin->n);
+      {
+        char dummy;
+
+        if (1 !=
+            sscanf (plugin->n,
+                    "%u%c",
+                    &namespace_n,
+                    &dummy))
+        {
+          // FIXME: how to handle error nicely?
+          GNUNET_break (0);
+          namespace_n = 0;
+        }
+      }
+
+      if (0 == namespace_n)
+      {
+        LOG (GNUNET_ERROR_TYPE_DEBUG,
+             "known node n: %s\n",
+             plugin->n);
+        GNUNET_asprintf (&node_ip,
+                         KNOWN_BASE_IP "%s",
+                         plugin->m);
+      }
+      else
+      {
+        LOG (GNUNET_ERROR_TYPE_DEBUG,
+             "subnet node n: %s\n",
+             plugin->n);
+        GNUNET_asprintf (&node_ip,
+                         NODE_BASE_IP "%s",
+                         plugin->m);
+      }
+
+      is = plugin->api->start_testcase (&write_message,
+                                        router_ip,
+                                        node_ip,
+                                        plugin->m,
+                                        plugin->n,
+                                        plugin->local_m,
+                                        ni->topology_data,
+                                        ni->read_file,
+                                        &finished_cb);
+      GNUNET_free (node_ip);
+      GNUNET_free (binary);
+      GNUNET_free (router_ip);
+      GNUNET_free (plugin_name);
+
+      msg_length = sizeof(struct GNUNET_TESTING_CommandHelperReply);
+      reply = GNUNET_new (struct GNUNET_TESTING_CommandHelperReply);
+      reply->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY);
+      reply->header.size = htons ((uint16_t) msg_length);
+      write_message (&reply->header,
+                     msg_length);
+      return GNUNET_OK;
     }
-    plugin_name = GNUNET_malloc (plugin_name_size + 1);
-    GNUNET_strlcpy (plugin_name,
-                    ((char *) &msg[1]),
-                    plugin_name_size + 1);
-
-    binary = GNUNET_OS_get_libexec_binary_path ("gnunet-cmd");
-
-    plugin = GNUNET_new (struct TestcasePlugin);
-    plugin->api = GNUNET_PLUGIN_load (plugin_name,
-                                      NULL);
-    plugin->library_name = GNUNET_strdup (basename (plugin_name));
-
-    plugin->global_n = ni->global_n;
-    plugin->local_m = ni->local_m;
-    plugin->n = ni->n;
-    plugin->m = ni->m;
-
-    router_ip = GNUNET_malloc (strlen (ROUTER_BASE_IP) + strlen (plugin->n)
-                               + 1);
-    strcpy (router_ip, ROUTER_BASE_IP);
-    strcat (router_ip, plugin->n);
-
-    sscanf (plugin->n, "%u", &namespace_n);
-
-    if (0 == namespace_n)
+  case GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE:
     {
-      LOG (GNUNET_ERROR_TYPE_ERROR,
-           "known node n: %s\n",
-           plugin->n);
-      node_ip = GNUNET_malloc (strlen (KNOWN_BASE_IP) + strlen (plugin->m) + 
1);
-      strcat (node_ip, KNOWN_BASE_IP);
+      const char *barrier_name;
+      struct CommandBarrierCrossable *adm = (struct
+                                             CommandBarrierCrossable *) 
message;
+
+      barrier_name = (const char *) &adm[1];
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "cross barrier %s\n",
+           barrier_name);
+      TST_interpreter_finish_attached_cmds (is,
+                                            barrier_name);
+      return GNUNET_OK;
     }
-    else
+  case GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_PEERS_STARTED:
     {
-      LOG (GNUNET_ERROR_TYPE_ERROR,
-           "subnet node n: %s\n",
-           plugin->n);
-      node_ip = GNUNET_malloc (strlen (NODE_BASE_IP) + strlen (plugin->m) + 1);
-      strcat (node_ip, NODE_BASE_IP);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "all peers started\n");
+      plugin->api->all_peers_started ();
+      return GNUNET_OK;
     }
-    strcat (node_ip, plugin->m);
-
-    is = plugin->api->start_testcase (&write_message, router_ip, node_ip, 
plugin->m,
-
-                                 plugin->n, plugin->local_m, ni->topology_data,
-                                 ni->read_file, &finished_cb);
-    GNUNET_free (node_ip);
-    GNUNET_free (binary);
-    GNUNET_free (router_ip);
-    GNUNET_free (plugin_name);
-
-    msg_length = sizeof(struct GNUNET_TESTING_CommandHelperReply);
-    reply = GNUNET_new (struct GNUNET_TESTING_CommandHelperReply);
-    reply->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY);
-    reply->header.size = htons ((uint16_t) msg_length);
-
-    write_message ((struct GNUNET_MessageHeader *) reply, msg_length);
-
-    return GNUNET_OK;
-  }
-  else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE == ntohs (
-             message->type))
-  {
-    const char *barrier_name;
-    struct CommandBarrierCrossable *adm = (struct CommandBarrierCrossable *) 
message;
-
-    barrier_name = (const char *) &adm[1];
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "cross barrier %s\n",
-         barrier_name);
-    TST_interpreter_finish_attached_cmds (is, barrier_name);
-    return GNUNET_OK;
-  }
-  else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_PEERS_STARTED == ntohs (
-             message->type))
-  {
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "all peers started\n");
-    plugin->api->all_peers_started ();
-    return GNUNET_OK;
-  }
-  else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_LOCAL_TESTS_PREPARED == ntohs (
-             message->type))
-  {
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "all local tests prepared\n");
-    plugin->api->all_local_tests_prepared ();
-    return GNUNET_OK;
-  }
-  else
-  {
+  case GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_LOCAL_TESTS_PREPARED:
+    {
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "all local tests prepared\n");
+      plugin->api->all_local_tests_prepared ();
+      return GNUNET_OK;
+    }
+  default:
     LOG (GNUNET_ERROR_TYPE_WARNING, "Received unexpected message -- 
exiting\n");
     goto error;
   }
 
-
-  error:
+error:
   status = GNUNET_SYSERR;
   LOG (GNUNET_ERROR_TYPE_ERROR,
        "tokenizer shutting down!\n");
@@ -560,14 +578,16 @@ run (void *cls,
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Starting interpreter loop helper...\n");
 
-  tokenizer = GNUNET_MST_create (&tokenizer_cb, ni);
+  tokenizer = GNUNET_MST_create (&tokenizer_cb,
+                                 ni);
   stdin_fd = GNUNET_DISK_get_handle_from_native (stdin);
   stdout_fd = GNUNET_DISK_get_handle_from_native (stdout);
   read_task_id = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
                                                  stdin_fd,
                                                  &read_task,
                                                  NULL);
-  GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
+  GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
+                                 NULL);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Interpreter loop helper started.\n");
 }
@@ -605,8 +625,9 @@ main (int argc, char **argv)
 {
   struct NodeIdentifier *ni;
   struct GNUNET_SIGNAL_Context *shc_chld;
-  struct GNUNET_GETOPT_CommandLineOption options[] =
-  { GNUNET_GETOPT_OPTION_END };
+  struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
   int ret;
   unsigned int sscanf_ret;
   int i;
@@ -667,8 +688,8 @@ main (int argc, char **argv)
     return 1;
   }
   shc_chld =
-    GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
-
+    GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD,
+                                   &sighandler_child_death);
   ret = GNUNET_PROGRAM_run (argc,
                             argv,
                             "gnunet-cmds-helper",
diff --git a/src/testing/testing_api_cmd_barrier.c 
b/src/testing/testing_api_cmd_barrier.c
index 9dd154059..c9c43b178 100644
--- a/src/testing/testing_api_cmd_barrier.c
+++ b/src/testing/testing_api_cmd_barrier.c
@@ -130,6 +130,7 @@ barrier_traits (void *cls,
                                    index);
 }
 
+
 /**
  * Cleanup the state from a "barrier" CMD, and possibly
  * cancel a pending operation thereof.
@@ -144,6 +145,7 @@ barrier_cleanup (void *cls)
   GNUNET_free (brs);
 }
 
+
 /**
  * Run the command.
  *
@@ -159,6 +161,7 @@ barrier_run (void *cls,
   TST_interpreter_add_barrier (is, brs->barrier);
 }
 
+
 struct GNUNET_TESTING_NetjailNode *
 GNUNET_TESTING_barrier_get_node (struct GNUNET_TESTING_Barrier *barrier,
                                  unsigned int node_number)
diff --git a/src/testing/testing_api_cmd_barrier_reached.c 
b/src/testing/testing_api_cmd_barrier_reached.c
index 3c2ba3a1d..0075f8ef0 100644
--- a/src/testing/testing_api_cmd_barrier_reached.c
+++ b/src/testing/testing_api_cmd_barrier_reached.c
@@ -92,7 +92,8 @@ barrier_reached_run (void *cls,
 {
   struct BarrierReachedState *brs = cls;
   struct GNUNET_TESTING_Barrier *barrier;
-  struct GNUNET_TESTING_Command *cmd = 
GNUNET_TESTING_interpreter_get_current_command (is);
+  struct GNUNET_TESTING_Command *cmd =
+    GNUNET_TESTING_interpreter_get_current_command (is);
   struct CommandListEntry *cle;
   size_t msg_length;
   struct GNUNET_TESTING_CommandBarrierReached *msg;
@@ -105,8 +106,8 @@ barrier_reached_run (void *cls,
     barrier->name = brs->barrier_name;
     TST_interpreter_add_barrier (is, barrier);
     LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "barrier %s added locally\n",
-       brs->barrier_name);
+         "barrier %s added locally\n",
+         brs->barrier_name);
   }
   barrier->reached++;
   if (GNUNET_TESTING_barrier_crossable (barrier))
@@ -133,13 +134,14 @@ barrier_reached_run (void *cls,
     char *terminator = "\0";
 
     name_len = strlen (barrier->name);
-    msg_length = sizeof(struct GNUNET_TESTING_CommandBarrierReached) + 
name_len + 1;
+    msg_length = sizeof(struct GNUNET_TESTING_CommandBarrierReached)
+                 + name_len + 1;
     msg = GNUNET_malloc (msg_length);
     msg->header.size = htons ((uint16_t) msg_length);
     msg->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_REACHED);
     msg->node_number = brs->node_number;
     memcpy (&msg[1], barrier->name, name_len + 1);
-    memcpy(&msg[name_len + 1],terminator,1);
+    memcpy (&msg[name_len + 1],terminator,1);
     brs->write_message ((struct GNUNET_MessageHeader *) msg, msg_length);
   }
 }
diff --git a/src/testing/testing_api_cmd_block_until_external_trigger.c 
b/src/testing/testing_api_cmd_block_until_external_trigger.c
index 81a43a3ac..58f095842 100644
--- a/src/testing/testing_api_cmd_block_until_external_trigger.c
+++ b/src/testing/testing_api_cmd_block_until_external_trigger.c
@@ -48,6 +48,7 @@ block_until_all_peers_started_cleanup (void *cls)
   GNUNET_free (bs);
 }
 
+
 static int
 block_until_external_trigger_traits (void *cls,
                                      const void **ret,
diff --git a/src/testing/testing_api_cmd_netjail_start_cmds_helper.c 
b/src/testing/testing_api_cmd_netjail_start_cmds_helper.c
index f1ef9fef1..51a20dd9b 100644
--- a/src/testing/testing_api_cmd_netjail_start_cmds_helper.c
+++ b/src/testing/testing_api_cmd_netjail_start_cmds_helper.c
@@ -293,7 +293,6 @@ send_message_to_locals (
   helper = ns->helper[count - 1];
 
 
-
   struct GNUNET_HELPER_SendHandle *sh = GNUNET_HELPER_send (
     (struct GNUNET_HELPER_Handle *) helper,
     header,
@@ -385,7 +384,7 @@ barrier_reached (struct NetJailState *ns, const struct
                                                      *) message;
 
   barrier_name = (const char *) &rm[1];
-  
+
   barrier = TST_interpreter_get_barrier (ns->is, barrier_name);
   GNUNET_assert (NULL != barrier);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -396,13 +395,13 @@ barrier_reached (struct NetJailState *ns, const struct
   barrier->reached++;
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "%u %p\n",
-           barrier->reached,
-           barrier);
+       barrier->reached,
+       barrier);
   if (GNUNET_TESTING_barrier_crossable (barrier))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "%s can be crossed\n",
-       barrier_name);
+         "%s can be crossed\n",
+         barrier_name);
     TST_interpreter_finish_attached_cmds (ns->is, barrier->name);
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -485,7 +484,8 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader 
*message)
     if (GNUNET_OK != lf->rv)
     {
       GNUNET_TESTING_async_fail (&(ns->ac));
-    } else if (ns->number_of_local_tests_finished == total_number)
+    }
+    else if (ns->number_of_local_tests_finished == total_number)
     {
       GNUNET_SCHEDULER_cancel (ns->timeout_task);
       ns->timeout_task = NULL;
@@ -509,8 +509,6 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader 
*message)
        ns->known);
 
 
-
-
   return GNUNET_OK;
 }
 
@@ -737,22 +735,22 @@ start_helper (struct NetJailState *ns,
     if (NULL == barrier)
     {
       LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "barrier %s added\n",
-       pos->barrier_name);
+           "barrier %s added\n",
+           pos->barrier_name);
       barrier = GNUNET_new (struct GNUNET_TESTING_Barrier);
       barrier->name = pos->barrier_name;
       barrier->shadow = GNUNET_YES;
       TST_interpreter_add_barrier (ns->is, barrier);
 
       LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "%u %p\n",
+           "%u %p\n",
            barrier->reached,
            barrier);
 
       barrier->nodes = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO);
     }
     LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "barrier %p %s node %u added \n",
+         "barrier %p %s node %u added \n",
          barrier,
          pos->barrier_name,
          node->node_number);
@@ -859,7 +857,7 @@ netjail_exec_run (void *cls,
     for (int j = 1; j <= ns->local_m; j++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "i %u j %u\n",
+                  "i %u j %u\n",
                   i,
                   j);
       start_helper (ns,
diff --git a/src/testing/testing_api_cmd_send_peer_ready.c 
b/src/testing/testing_api_cmd_send_peer_ready.c
index dcd69e595..f615a1cee 100644
--- a/src/testing/testing_api_cmd_send_peer_ready.c
+++ b/src/testing/testing_api_cmd_send_peer_ready.c
@@ -109,7 +109,8 @@ send_peer_ready_run (void *cls,
  */
 struct GNUNET_TESTING_Command
 GNUNET_TESTING_cmd_send_peer_ready (const char *label,
-                                    GNUNET_TESTING_cmd_helper_write_cb 
write_message)
+                                    GNUNET_TESTING_cmd_helper_write_cb
+                                    write_message)
 {
   struct SendPeerReadyState *sprs;
 
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index e34f87cc2..db0a00c22 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -123,7 +123,7 @@ struct FreeBarrierNodeCbCls
 };
 
 
-const struct GNUNET_TESTING_Command *
+static const struct GNUNET_TESTING_Command *
 get_command (struct GNUNET_TESTING_Interpreter *is,
              const char *label,
              unsigned int future)
@@ -265,7 +265,7 @@ free_barrier_node_cb (void *cls,
 }
 
 
-int
+static int
 free_barriers_cb (void *cls,
                   const struct GNUNET_ShortHashCode *key,
                   void *value)
@@ -574,14 +574,19 @@ GNUNET_TESTING_run (const struct GNUNET_TESTING_Command 
*commands,
   is = GNUNET_new (struct GNUNET_TESTING_Interpreter);
   is->rc = rc;
   is->rc_cls = rc_cls;
-  is->barriers = GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO);
+  is->barriers = GNUNET_CONTAINER_multishortmap_create (1,
+                                                        false);
   /* get the number of commands */
   for (i = 0; NULL != commands[i].run; i++)
     ;
   is->cmds_n = i + 1;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got %u commands\n", i);
-  is->commands = GNUNET_new_array (is->cmds_n,
-                                   struct GNUNET_TESTING_Command);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Got %u commands\n",
+              i);
+  is->commands = GNUNET_malloc_large ( (i + 1)
+                                       * sizeof (struct
+                                                 GNUNET_TESTING_Command));
+  GNUNET_assert (NULL != is->commands);
   memcpy (is->commands,
           commands,
           sizeof (struct GNUNET_TESTING_Command) * i);
@@ -701,9 +706,9 @@ loop_run (void *cls)
  * Continuation function from GNUNET_HELPER_send()
  *
  * @param cls closure
- * @param result GNUNET_OK on success,
- *               GNUNET_NO if helper process died
- *               GNUNET_SYSERR during GNUNET_HELPER_stop
+ * @param result #GNUNET_OK on success,
+ *               #GNUNET_NO if helper process died
+ *               #GNUNET_SYSERR during GNUNET_HELPER_stop()
  */
 static void
 clear_msg (void *cls, int result)
@@ -761,7 +766,6 @@ TST_interpreter_send_barrier_crossable (struct 
GNUNET_TESTING_Interpreter *is,
   struct CommandBarrierCrossable *adm;
   size_t msg_length;
   size_t name_len;
-  char *terminator = "\0";
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "send barrier name %s barrier_name\n",
@@ -813,7 +817,6 @@ TST_interpreter_finish_attached_cmds (struct 
GNUNET_TESTING_Interpreter *is,
                                       const char *barrier_name)
 {
   struct CommandListEntry *pos;
-  struct FreeBarrierNodeCbCls *free_barrier_node_cb_cls;
   struct GNUNET_TESTING_Barrier *barrier = TST_interpreter_get_barrier (is,
                                                                         
barrier_name);
 
@@ -846,17 +849,18 @@ TST_interpreter_finish_attached_cmds (struct 
GNUNET_TESTING_Interpreter *is,
   }
   if (NULL != barrier->nodes)
   {
-    free_barrier_node_cb_cls = GNUNET_new (struct FreeBarrierNodeCbCls);
-    free_barrier_node_cb_cls->barrier = barrier;
-    free_barrier_node_cb_cls->is = is;
+    struct FreeBarrierNodeCbCls free_barrier_node_cb_cls = {
+      .barrier = barrier,
+      .is = is
+    };
+
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "freeing nodes\n");
     GNUNET_CONTAINER_multishortmap_iterate (barrier->nodes,
-                                            free_barrier_node_cb,
-                                            free_barrier_node_cb_cls);
+                                            &free_barrier_node_cb,
+                                            &free_barrier_node_cb_cls);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "nodes freed\n");
-    GNUNET_free (free_barrier_node_cb_cls);
     GNUNET_CONTAINER_multishortmap_destroy (barrier->nodes);
     barrier->nodes = NULL;
   }
diff --git a/src/transport/gnunet-communicator-quic.c 
b/src/transport/gnunet-communicator-quic.c
index 700fd0ca4..76b0ebd62 100644
--- a/src/transport/gnunet-communicator-quic.c
+++ b/src/transport/gnunet-communicator-quic.c
@@ -21,9 +21,9 @@
 /* Currently equivalent to QUICHE_MAX_CONN_ID_LEN */
 #define LOCAL_CONN_ID_LEN 20
 #define MAX_TOKEN_LEN \
-        sizeof("quiche") - 1 + \
-        sizeof(struct sockaddr_storage) + \
-        QUICHE_MAX_CONN_ID_LEN
+  sizeof("quiche") - 1   \
+  + sizeof(struct sockaddr_storage)   \
+  + QUICHE_MAX_CONN_ID_LEN
 #define CID_LEN sizeof(uint8_t) * QUICHE_MAX_CONN_ID_LEN
 #define TOKEN_LEN sizeof(uint8_t) * MAX_TOKEN_LEN
 /* Generic, bidirectional, client-initiated quic stream id */
diff --git a/src/transport/gnunet-communicator-tcp.c 
b/src/transport/gnunet-communicator-tcp.c
index d8d37bbb7..faacb3aab 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -52,7 +52,7 @@
  * the other peer should revalidate).
  */
 #define ADDRESS_VALIDITY_PERIOD \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
 
 /**
  * How many messages do we keep at most in the queue to the
@@ -91,16 +91,16 @@
  * directions.
  */
 #define INITIAL_KX_SIZE                           \
-        (sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)   \
-         + sizeof(struct TCPConfirmation))
+  (sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)   \
+   + sizeof(struct TCPConfirmation))
 
 /**
  * Size of the initial core key exchange messages.
  */
 #define INITIAL_CORE_KX_SIZE          \
-        (sizeof(struct EphemeralKeyMessage)   \
-         + sizeof(struct PingMessage) \
-         + sizeof(struct PongMessage))
+  (sizeof(struct EphemeralKeyMessage)   \
+   + sizeof(struct PingMessage) \
+   + sizeof(struct PongMessage))
 
 /**
  * Address prefix used by the communicator.
diff --git a/src/transport/gnunet-communicator-udp.c 
b/src/transport/gnunet-communicator-udp.c
index 50e66e13a..f5cf7ab0f 100644
--- a/src/transport/gnunet-communicator-udp.c
+++ b/src/transport/gnunet-communicator-udp.c
@@ -68,7 +68,7 @@
  * How often do we scan for changes to our network interfaces?
  */
 #define INTERFACE_SCAN_FREQUENCY \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
 
 /**
  * How long do we believe our addresses to remain up (before
@@ -77,7 +77,7 @@
 #define ADDRESS_VALIDITY_PERIOD GNUNET_TIME_UNIT_HOURS
 
 #define WORKING_QUEUE_INTERVALL \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,1)
 
 /**
  * AES key size.
diff --git a/src/transport/gnunet-service-tng.c 
b/src/transport/gnunet-service-tng.c
index a008daff3..083db325e 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -186,20 +186,20 @@
  * the value chosen here might be too aggressively low!
  */
 #define DELAY_WARN_THRESHOLD \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
 
 /**
  * If a DVBox could not be forwarded after this number of
  * seconds we drop it.
  */
 #define DV_FORWARD_TIMEOUT \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 
 /**
  * Default value for how long we wait for reliability ack.
  */
 #define DEFAULT_ACK_WAIT_DURATION \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
 
 /**
  * We only consider queues as "quality" connections when
@@ -207,53 +207,53 @@
  * the latency of the queue is below this threshold.
  */
 #define DV_QUALITY_RTT_THRESHOLD \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
 
 /**
  * How long do we consider a DV path valid if we see no
  * further updates on it? Note: the value chosen here might be too low!
  */
 #define DV_PATH_VALIDITY_TIMEOUT \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
 
 /**
  * How long do we cache backchannel (struct Backtalker) information
  * after a backchannel goes inactive?
  */
 #define BACKCHANNEL_INACTIVITY_TIMEOUT \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
 
 /**
  * How long before paths expire would we like to (re)discover DV paths? Should
  * be below #DV_PATH_VALIDITY_TIMEOUT.
  */
 #define DV_PATH_DISCOVERY_FREQUENCY \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
 
 /**
  * How long are ephemeral keys valid?
  */
 #define EPHEMERAL_VALIDITY \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
 
 /**
  * How long do we keep partially reassembled messages around before giving up?
  */
 #define REASSEMBLY_EXPIRATION \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
 
 /**
  * What is the fastest rate at which we send challenges *if* we keep learning
  * an address (gossip, DHT, etc.)?
  */
 #define FAST_VALIDATION_CHALLENGE_FREQ \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
 
 /**
  * What is the slowest rate at which we send challenges?
  */
 #define MAX_VALIDATION_CHALLENGE_FREQ \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1)
 
 /**
  * How long until we forget about historic accumulators and thus
@@ -261,7 +261,7 @@
  * active connection experiences without an ACK.
  */
 #define ACK_CUMMULATOR_TIMEOUT \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
 
 /**
  * What is the non-randomized base frequency at which we
@@ -279,13 +279,13 @@
  * When do we forget an invalid address for sure?
  */
 #define MAX_ADDRESS_VALID_UNTIL \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1)
 
 /**
  * How long do we consider an address valid if we just checked?
  */
 #define ADDRESS_VALIDATION_LIFETIME \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
 
 /**
  * What is the maximum frequency at which we do address validation?
diff --git a/src/transport/plugin_transport_http_common.c 
b/src/transport/plugin_transport_http_common.c
index 40353daeb..a033985e1 100644
--- a/src/transport/plugin_transport_http_common.c
+++ b/src/transport/plugin_transport_http_common.c
@@ -604,7 +604,7 @@ http_common_plugin_address_to_string (const char *plugin,
   if (addr_str[ntohl (address->urlen) - 1] != '\0')
     return NULL;
   GNUNET_asprintf (&res, "%s.%u.%s", plugin, ntohl (address->options),
-                   (char*)&address[1]);
+                   (char*) &address[1]);
   if (strlen (res) + 1 < 500)
   {
     GNUNET_memcpy (rbuf, res, strlen (res) + 1);
diff --git a/src/transport/plugin_transport_wlan.c 
b/src/transport/plugin_transport_wlan.c
index 138fb5080..3ac106859 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -1873,7 +1873,8 @@ handle_helper_message (void *cls,
       LOG (GNUNET_ERROR_TYPE_DEBUG,
            "Size of packet is too small (%llu bytes < %llu)\n",
            (unsigned long long) msize,
-           (unsigned long long) sizeof(struct 
GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage));
+           (unsigned long long) sizeof(struct
+                                       
GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage));
       break;
     }
     rxinfo = (const struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage *) hdr;
diff --git a/src/transport/test_communicator_basic.c 
b/src/transport/test_communicator_basic.c
index 1658c2151..713275fd3 100644
--- a/src/transport/test_communicator_basic.c
+++ b/src/transport/test_communicator_basic.c
@@ -104,13 +104,13 @@ static unsigned int iterations_left[NUM_PEERS];
 #define TIMEOUT_MULTIPLIER 1
 
 #define DELAY \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,200)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,200)
 
 #define SHORT_BURST_WINDOW \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2)
 
 #define LONG_BURST_WINDOW \
-        GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2)
+  GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,2)
 
 enum TestPhase
 {
diff --git a/src/transport/test_transport_api2.c 
b/src/transport/test_transport_api2.c
index e1606e0be..4d423f7c2 100644
--- a/src/transport/test_transport_api2.c
+++ b/src/transport/test_transport_api2.c
@@ -28,7 +28,7 @@
  * C code apparently.
  */
 #include "platform.h"
-//#include "gnunet_transport_service.h"
+// #include "gnunet_transport_service.h"
 #include "transport-testing2.h"
 
 /**
diff --git a/src/transport/test_transport_plugin_cmd_nat_upnp.c 
b/src/transport/test_transport_plugin_cmd_nat_upnp.c
index 1b02fbfc2..bb1c2be0a 100644
--- a/src/transport/test_transport_plugin_cmd_nat_upnp.c
+++ b/src/transport/test_transport_plugin_cmd_nat_upnp.c
@@ -90,7 +90,7 @@ handle_test (void *cls,
 struct GNUNET_TESTING_BarrierList*
 get_waiting_for_barriers ()
 {
-  struct GNUNET_TESTING_BarrierList* barriers;
+  struct GNUNET_TESTING_BarrierList*barriers;
   struct GNUNET_TESTING_BarrierListEntry *ble;
 
   barriers = GNUNET_new (struct GNUNET_TESTING_BarrierList);
@@ -209,7 +209,7 @@ all_local_tests_prepared ()
  *        the topology configuration.
  * @param read_file If read_file is GNUNET_YES this string is the filename for 
the topology configuration,
  *        if read_file is GNUNET_NO the string contains the topology 
configuration.
- * @param finish_cb Callback function which writes a message from the helper 
process running on a netjail 
+ * @param finish_cb Callback function which writes a message from the helper 
process running on a netjail
  *                  node to the master process * signaling that the test case 
running on the netjail node finished.
  * @return Returns the struct GNUNET_TESTING_Interpreter of the command loop 
running on this netjail node.
  */
@@ -357,9 +357,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb 
write_message,
   ts->write_message = write_message;
 
   is = GNUNET_TESTING_run (commands,
-                      TIMEOUT,
-                      &handle_result,
-                      ts);
+                           TIMEOUT,
+                           &handle_result,
+                           ts);
   return is;
 }
 
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c 
b/src/transport/test_transport_plugin_cmd_simple_send.c
index 375796dff..8a96e19f9 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send.c
@@ -90,7 +90,7 @@ handle_test (void *cls,
 struct GNUNET_TESTING_BarrierList *
 get_waiting_for_barriers ()
 {
-  //No Barrier
+  // No Barrier
   return GNUNET_new (struct GNUNET_TESTING_BarrierList);
 }
 
@@ -326,9 +326,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb 
write_message,
   ts->write_message = write_message;
 
   is = GNUNET_TESTING_run (commands,
-                      TIMEOUT,
-                      &handle_result,
-                      ts);
+                           TIMEOUT,
+                           &handle_result,
+                           ts);
   return is;
 }
 
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c 
b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
index 7381b1d7e..7000851c4 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
@@ -90,7 +90,7 @@ handle_test (void *cls,
 struct GNUNET_TESTING_BarrierList *
 get_waiting_for_barriers ()
 {
-  //No Barrier
+  // No Barrier
   return GNUNET_new (struct GNUNET_TESTING_BarrierList);
 }
 
@@ -147,12 +147,11 @@ static void *
 notify_connect (struct GNUNET_TESTING_Interpreter *is,
                 const struct GNUNET_PeerIdentity *peer)
 {
-  const struct GNUNET_TESTING_AsyncContext *ac;
+  struct GNUNET_TESTING_AsyncContext *ac;
   void *ret = NULL;
   const struct GNUNET_TESTING_Command *cmd;
   struct GNUNET_TESTING_BlockState *bs;
 
-
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "notify_connect\n");
 
@@ -165,9 +164,9 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
                 "notify_connect running\n");
     GNUNET_assert  (NULL != ac);
     if (NULL == ac->cont)
-      GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac);
+      GNUNET_TESTING_async_fail (ac);
     else
-      GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac);
+      GNUNET_TESTING_async_finish (ac);
   }
   else
   {
@@ -179,7 +178,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
          cmd->label);
     GNUNET_TESTING_get_trait_block_state (
       cmd,
-      (const struct GNUNET_TESTING_BlockState  **) &bs);
+      &bs);
 
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "block state %u\n",
@@ -353,9 +352,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb 
write_message,
   ts->write_message = write_message;
 
   is = GNUNET_TESTING_run (commands,
-                      TIMEOUT,
-                      &handle_result,
-                      ts);
+                           TIMEOUT,
+                           &handle_result,
+                           ts);
   return is;
 }
 
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c 
b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
index 55ab4a48f..52174e539 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
@@ -113,7 +113,7 @@ handle_test (void *cls,
     GNUNET_TESTING_get_trait_async_context (&block_receive,
                                             &ac_block);
 
-    if ( connected == number_received)
+    if (connected == number_received)
     {
       if (NULL != ac_block->is)
       {
@@ -142,7 +142,7 @@ handle_test (void *cls,
 struct GNUNET_TESTING_BarrierList *
 get_waiting_for_barriers ()
 {
-  //No Barrier
+  // No Barrier
   return GNUNET_new (struct GNUNET_TESTING_BarrierList);
 }
 
@@ -201,19 +201,21 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
 {
   const struct ConnectPeersState *cps;
   const struct GNUNET_TESTING_Command *cmd;
-  void *ret = NULL;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "notify_connect peer %s\n",
               GNUNET_i2s (peer));
+  // FIXME: modifying future is a bit unclean, not easy to follow logic;
+  // might be better to when reaching the future command to look into
+  // the past...
   cmd = GNUNET_TESTING_interpreter_lookup_command_all (is,
                                                        "connect-peers");
+  // FIXME: check return value!
   GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd,
                                                  &cps);
   cps->notify_connect (is,
                        peer);
-
-  return ret;
+  return NULL;
 }
 
 
@@ -381,9 +383,9 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb 
write_message,
   ts->write_message = write_message;
 
   is = GNUNET_TESTING_run (commands,
-                      TIMEOUT,
-                      &handle_result,
-                      ts);
+                           TIMEOUT,
+                           &handle_result,
+                           ts);
   return is;
 }
 
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c 
b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
index 5e931fbe3..28cbd33ba 100644
--- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c
+++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
@@ -155,6 +155,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
   return ret;
 }
 
+
 /**
  * Callback to set the flag indicating all peers are prepared to finish. Will 
be called via the plugin api.
  */
@@ -173,6 +174,7 @@ all_local_tests_prepared ()
                                   GNUNET_TESTING_AsyncContext *) &lfs->ac);
 }
 
+
 /**
  * Function to start a local test case.
  *
diff --git a/src/transport/test_transport_start_with_config.c 
b/src/transport/test_transport_start_with_config.c
index 8a7a3dbb5..9a8b5ee05 100644
--- a/src/transport/test_transport_start_with_config.c
+++ b/src/transport/test_transport_start_with_config.c
@@ -95,13 +95,13 @@ main (int argc,
                                       topology_data_script,
                                       &read_file),
     GNUNET_TESTING_cmd_netjail_start_cmds_helper ("netjail-start-testbed",
-                                                     topology,
-                                                     &read_file,
-                                                     topology_data_script,
-                                                     TIMEOUT),
+                                                  topology,
+                                                  &read_file,
+                                                  topology_data_script,
+                                                  TIMEOUT),
     GNUNET_TESTING_cmd_stop_cmds_helper ("stop-testbed",
-                                            "netjail-start-testbed",
-                                            topology),
+                                         "netjail-start-testbed",
+                                         topology),
     GNUNET_TESTING_cmd_netjail_stop ("netjail-stop",
                                      topology_data_script,
                                      &read_file),
diff --git a/src/transport/transport-testing2.c 
b/src/transport/transport-testing2.c
index 566e0db71..ec27ac8ba 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -329,6 +329,7 @@ notify_disconnect (void *cls,
   }
 }
 
+
 static void
 retrieve_hello (void *cls);
 
diff --git a/src/transport/transport_api_cmd_backchannel_check.c 
b/src/transport/transport_api_cmd_backchannel_check.c
index d672e3ae8..1bdb8817f 100644
--- a/src/transport/transport_api_cmd_backchannel_check.c
+++ b/src/transport/transport_api_cmd_backchannel_check.c
@@ -330,6 +330,7 @@ will_the_other_node_connect_via_udp (
   return GNUNET_NO;
 }
 
+
 static void
 add_search_string (struct CheckState *cs, const struct
                    GNUNET_TESTING_NetjailNode *node)
diff --git a/src/transport/transport_api_cmd_connecting_peers.c 
b/src/transport/transport_api_cmd_connecting_peers.c
index 7feecbcc7..6bc145880 100644
--- a/src/transport/transport_api_cmd_connecting_peers.c
+++ b/src/transport/transport_api_cmd_connecting_peers.c
@@ -126,10 +126,10 @@ connect_peers_run (void *cls,
           char *rest2;
           char *address;
 
-          prefix = strtok(addr, "_");
-          rest = strtok(NULL, "_");
-          rest2 = strtok(rest, "-");
-          address = strtok(NULL, "-");
+          prefix = strtok (addr, "_");
+          rest = strtok (NULL, "_");
+          rest2 = strtok (rest, "-");
+          address = strtok (NULL, "-");
 
           GNUNET_asprintf (&addr_and_port,
                            "%s-%s:0",
@@ -172,20 +172,23 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
   const struct GNUNET_TESTING_Command *cmd;
   struct ConnectPeersState *cps;
   struct GNUNET_PeerIdentity *peer_connection;
-  struct GNUNET_TESTING_NodeConnection *pos_connection;
   unsigned int num;
   unsigned int con_num;
   void *ret = NULL;
 
   cmd = GNUNET_TESTING_interpreter_lookup_command_all (is,
                                                        "connect-peers");
-  cps = cmd->cls;
+  cps = cmd->cls; // WTF? Never go directly into cls of another command! FIXME!
   con_num = cps->con_num_notified;
-  for (pos_connection = cps->node_connections_head; NULL != pos_connection;
+  for (struct GNUNET_TESTING_NodeConnection *pos_connection =
+         cps->node_connections_head;
+       NULL != pos_connection;
        pos_connection = pos_connection->next)
   {
-    num = GNUNET_TESTING_calculate_num (pos_connection, cps->topology);
-    peer_connection = GNUNET_TESTING_get_peer (num, cps->tl_system);
+    num = GNUNET_TESTING_calculate_num (pos_connection,
+                                        cps->topology);
+    peer_connection = GNUNET_TESTING_get_peer (num,
+                                               cps->tl_system);
     if (0 == GNUNET_memcmp (peer,
                             peer_connection))
       cps->con_num_notified++;
diff --git a/src/transport/transport_api_cmd_start_peer.c 
b/src/transport/transport_api_cmd_start_peer.c
index 1f8ef2f8f..244f8d79b 100644
--- a/src/transport/transport_api_cmd_start_peer.c
+++ b/src/transport/transport_api_cmd_start_peer.c
@@ -385,7 +385,7 @@ start_peer_cleanup (void *cls)
     GNUNET_free (sps->handlers);
     sps->handlers = NULL;
   }
-  //TODO Investigate why this caused problems during shutdown.
+  // TODO Investigate why this caused problems during shutdown.
   /*if (NULL != sps->cfg)
   {
     GNUNET_CONFIGURATION_destroy (sps->cfg);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]