misc bugfixes
authorChristian Grothoff <christian@grothoff.org>
Tue, 4 Jun 2019 18:54:16 +0000 (20:54 +0200)
committerChristian Grothoff <christian@grothoff.org>
Tue, 4 Jun 2019 18:54:24 +0000 (20:54 +0200)
src/cadet/gnunet-service-cadet_channel.c
src/identity/gnunet-identity.c
src/json/test_json_mhd.c
src/transport/gnunet-communicator-tcp.c
src/transport/gnunet-communicator-udp.c
src/transport/gnunet-communicator-unix.c
src/transport/gnunet-service-tng.c
src/transport/test_transport_address_switch.c

index bd95428be107b32734f8e378b95634ba8b7504d2..a1f6e37c29bfd385bc1f0b0718203883973247d2 100644 (file)
@@ -1472,6 +1472,7 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
                                 1,
                                 GNUNET_NO);
       drop = ccc->head_recv;
+      GNUNET_assert (NULL != drop);
       GNUNET_CONTAINER_DLL_remove (ccc->head_recv,
                                    ccc->tail_recv,
                                    drop);
index e22ac9106de884dc7ed51035a806c440c7fec7d0..4d6b1db3fea9141fd434a4ac448ea9b0a4427355 100644 (file)
@@ -291,7 +291,7 @@ print_ego (void *cls,
   }
   if (! (list | monitor))
     return;
-  if (NULL == ego)
+  if ( (NULL == ego) || (NULL == identifier) )
     return;
   if ((NULL != set_ego) && (0 != strcmp (identifier, set_ego)))
     return;
index 13338b32cb20a241fb33de6f509c2060db4968b8..73efc4d97f5f223bf97d6d6fd230d6dc951b625e 100644 (file)
@@ -144,7 +144,6 @@ main (int argc, const char *const argv[])
   {
     GNUNET_break (0);
     MHD_stop_daemon (daemon);
-    GNUNET_free (url);
     json_decref (bigj);
     GNUNET_free (post_data);
     GNUNET_free (str);
index 8ab99700c692031875ad456930c58a86a49d942c..50264cf453a9f2b16a299d14e1cf5b9c6bb567ea 100644 (file)
@@ -1909,15 +1909,6 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address)
                                    queue->sock,
                                    &queue_read_kx,
                                    queue);
-  if (NULL == queue)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Failed to setup queue to %s at `%s'\n",
-                GNUNET_i2s (peer),
-                path);
-    GNUNET_NETWORK_socket_close (sock);
-    return GNUNET_NO;
-  }
   start_initial_kx_out (queue);
   return GNUNET_OK;
 }
index 1c2063d580c9d3502a3b3a5980014d617d08a64b..6193b9225196a5f01f6043b4557b9993d14cff7b 100644 (file)
@@ -1043,7 +1043,7 @@ check_timeouts (void *cls)
   st = GNUNET_TIME_UNIT_FOREVER_REL;
   while (NULL != (sender = GNUNET_CONTAINER_heap_peek (senders_heap)))
   {
-    st = GNUNET_TIME_absolute_get_remaining (receiver->timeout);
+    st = GNUNET_TIME_absolute_get_remaining (sender->timeout);
     if (0 != st.rel_value_us)
       break;
     sender_destroy (sender);
@@ -2112,51 +2112,6 @@ setup_receiver_mq (struct ReceiverAddress *receiver)
 }
 
 
-/**
- * Setup a receiver for transmission.  Setup the MQ processing and
- * inform transport that the queue is ready.
- *
- * @param target which peer are we talking to
- * @param address address of the peer
- * @param address_len number of bytes in @a address
- * @return handle for the address
- */
-static struct ReceiverAddress *
-receiver_setup (const struct GNUNET_PeerIdentity *target,
-                const struct sockaddr *address,
-                socklen_t address_len)
-{
-  struct ReceiverAddress *receiver;
-
-  receiver = GNUNET_new (struct ReceiverAddress);
-  receiver->address = GNUNET_memdup (address, address_len);
-  receiver->address_len = address_len;
-  receiver->target = *target;
-  receiver->nt = GNUNET_NT_scanner_get_type (is, address, address_len);
-  (void) GNUNET_CONTAINER_multipeermap_put (
-    receivers,
-    &receiver->target,
-    receiver,
-    GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-  receiver->timeout =
-    GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
-  receiver->hn = GNUNET_CONTAINER_heap_insert (receivers_heap,
-                                               receiver,
-                                               receiver->timeout.abs_value_us);
-  GNUNET_STATISTICS_set (stats,
-                         "# receivers active",
-                         GNUNET_CONTAINER_multipeermap_size (receivers),
-                         GNUNET_NO);
-  receiver->foreign_addr =
-    sockaddr_to_udpaddr_string (receiver->address, receiver->address_len);
-  setup_receiver_mq (receiver);
-
-  if (NULL == timeout_task)
-    timeout_task = GNUNET_SCHEDULER_add_now (&check_timeouts, NULL);
-  return receiver;
-}
-
-
 /**
  * Function called by the transport service to initialize a
  * message queue given address information about another peer.
@@ -2192,8 +2147,30 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address)
   }
   path = &address[strlen (COMMUNICATOR_ADDRESS_PREFIX "-")];
   in = udp_address_to_sockaddr (path, &in_len);
-  receiver = receiver_setup (peer, in, in_len);
-  (void) receiver;
+
+  receiver = GNUNET_new (struct ReceiverAddress);
+  receiver->address = in;
+  receiver->address_len = in_len;
+  receiver->target = *peer;
+  receiver->nt = GNUNET_NT_scanner_get_type (is, in, in_len);
+  (void) GNUNET_CONTAINER_multipeermap_put (receivers,
+                                            &receiver->target,
+                                            receiver,
+                                            GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
+  receiver->timeout =
+    GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
+  receiver->hn = GNUNET_CONTAINER_heap_insert (receivers_heap,
+                                               receiver,
+                                               receiver->timeout.abs_value_us);
+  GNUNET_STATISTICS_set (stats,
+                         "# receivers active",
+                         GNUNET_CONTAINER_multipeermap_size (receivers),
+                         GNUNET_NO);
+  receiver->foreign_addr =
+    sockaddr_to_udpaddr_string (receiver->address, receiver->address_len);
+  setup_receiver_mq (receiver);
+  if (NULL == timeout_task)
+    timeout_task = GNUNET_SCHEDULER_add_now (&check_timeouts, NULL);
   return GNUNET_OK;
 }
 
@@ -2489,14 +2466,14 @@ iface_proc (void *cls,
 
   (void) cls;
   (void) netmask;
+  if (NULL == addr)
+    return GNUNET_YES; /* need to know our address! */
   network = GNUNET_NT_scanner_get_type (is, addr, addrlen);
   if (GNUNET_NT_LOOPBACK == network)
   {
     /* Broadcasting on loopback does not make sense */
     return GNUNET_YES;
   }
-  if (NULL == addr)
-    return GNUNET_YES; /* need to know our address! */
   for (bi = bi_head; NULL != bi; bi = bi->next)
   {
     if ((bi->salen == addrlen) && (0 == memcmp (addr, bi->sa, addrlen)))
index 642703f29426184025f8aa6657c19794c9ab001d..9bbc02c65dcecdee81a4bc473b7f2c0c2eea08a1 100644 (file)
@@ -417,6 +417,7 @@ select_write_cb (void *cls)
   struct Queue *queue = queue_tail;
   const struct GNUNET_MessageHeader *msg = queue->msg;
   size_t msg_size = ntohs (msg->size);
+  const void *msg;
   ssize_t sent;
 
   /* take queue of the ready list */
@@ -432,12 +433,13 @@ select_write_cb (void *cls)
                                      NULL);
 
   /* send 'msg' */
+  msg = queue->msg;
   queue->msg = NULL;
   GNUNET_MQ_impl_send_continue (queue->mq);
  resend:
   /* Send the data */
   sent = GNUNET_NETWORK_socket_sendto (unix_sock,
-                                       queue->msg,
+                                       msg,
                                        msg_size,
                                        (const struct sockaddr *) queue->address,
                                        queue->address_len);
index 7cc9f193c4a28b6a8e33654b047039003c221dbd..9262e5e979576d9907290df1faeca1224cf8e483 100644 (file)
@@ -2980,7 +2980,8 @@ free_virtual_link (struct VirtualLink *vl)
 
   while (NULL != (pm = vl->pending_msg_head))
     free_pending_message (pm);
-  GNUNET_CONTAINER_multipeermap_remove (links, &vl->target, vl);
+  GNUNET_assert (GNUNET_YES ==
+                 GNUNET_CONTAINER_multipeermap_remove (links, &vl->target, vl));
   if (NULL != vl->visibility_task)
   {
     GNUNET_SCHEDULER_cancel (vl->visibility_task);
@@ -3006,7 +3007,9 @@ free_virtual_link (struct VirtualLink *vl)
 static void
 free_validation_state (struct ValidationState *vs)
 {
-  GNUNET_CONTAINER_multipeermap_remove (validation_map, &vs->pid, vs);
+  GNUNET_assert (
+    GNUNET_YES ==
+    GNUNET_CONTAINER_multipeermap_remove (validation_map, &vs->pid, vs));
   GNUNET_CONTAINER_heap_remove_node (vs->hn);
   vs->hn = NULL;
   if (NULL != vs->sc)
@@ -4650,6 +4653,7 @@ route_control_message_without_fc (const struct GNUNET_PeerIdentity *target,
   struct DistanceVector *dv;
 
   vl = lookup_virtual_link (target);
+  GNUNET_assert (NULL != vl);
   n = vl->n;
   dv = (0 != (options & RMO_DV_ALLOWED)) ? vl->dv : NULL;
   if (0 == (options & RMO_UNCONFIRMED_ALLOWED))
@@ -5101,6 +5105,7 @@ handle_del_address (void *cls,
                     const struct GNUNET_TRANSPORT_DelAddressMessage *dam)
 {
   struct TransportClient *tc = cls;
+  struct AddressListEntry *alen;
 
   if (CT_COMMUNICATOR != tc->type)
   {
@@ -5110,8 +5115,9 @@ handle_del_address (void *cls,
   }
   for (struct AddressListEntry *ale = tc->details.communicator.addr_head;
        NULL != ale;
-       ale = ale->next)
+       ale = alen)
   {
+    alen = ale->next;
     if (dam->aid != ale->aid)
       continue;
     GNUNET_assert (ale->tc == tc);
@@ -5515,10 +5521,10 @@ handle_fragment_box (void *cls, const struct TransportFragmentBoxMessage *fb)
   msize = ntohs (fb->msg_size);
   fc.message_uuid = fb->msg_uuid;
   fc.rc = NULL;
-  GNUNET_CONTAINER_multihashmap32_get_multiple (n->reassembly_map,
-                                                fb->msg_uuid.uuid,
-                                                &find_by_message_uuid,
-                                                &fc);
+  (void) GNUNET_CONTAINER_multihashmap32_get_multiple (n->reassembly_map,
+                                                       fb->msg_uuid.uuid,
+                                                       &find_by_message_uuid,
+                                                       &fc);
   if (NULL == (rc = fc.rc))
   {
     rc = GNUNET_malloc (sizeof (*rc) + msize + /* reassembly payload buffer */
@@ -7756,6 +7762,7 @@ handle_validation_challenge (
   struct GNUNET_TIME_RelativeNBO validity_duration;
   struct IncomingRequest *ir;
   struct Neighbour *n;
+  struct GNUNET_PeerIdentity sender;
 
   /* DV-routed messages are not allowed for validation challenges */
   if (cmc->total_hops > 0)
@@ -7794,9 +7801,9 @@ handle_validation_challenge (
   route_control_message_without_fc (&cmc->im.sender,
                                     &tvr.header,
                                     RMO_ANYTHING_GOES | RMO_REDUNDANT);
+  sender = cmc->im.sender;
   finish_cmc_handling (cmc);
-
-  vl = lookup_virtual_link (&cmc->im.sender);
+  vl = lookup_virtual_link (&sender);
   if (NULL != vl)
     return;
 
@@ -7805,17 +7812,17 @@ handle_validation_challenge (
      CORE), so we must try to bring the link up! */
 
   /* (1) Check existing queues, if any, we may be lucky! */
-  n = lookup_neighbour (&cmc->im.sender);
+  n = lookup_neighbour (&sender);
   if (NULL != n)
     for (struct Queue *q = n->queue_head; NULL != q; q = q->next_neighbour)
-      start_address_validation (&cmc->im.sender, q->address);
+      start_address_validation (&sender, q->address);
   /* (2) Also try to see if we have addresses in PEERSTORE for this peer
      we could use */
   for (ir = ir_head; NULL != ir; ir = ir->next)
-    if (0 == GNUNET_memcmp (&ir->pid, &cmc->im.sender))
+    if (0 == GNUNET_memcmp (&ir->pid, &sender))
       return; /* we are already trying */
   ir = GNUNET_new (struct IncomingRequest);
-  ir->pid = cmc->im.sender;
+  ir->pid = sender;
   GNUNET_CONTAINER_DLL_insert (ir_head, ir_tail, ir);
   ir->wc = GNUNET_PEERSTORE_watch (peerstore,
                                    "transport",
@@ -9190,6 +9197,7 @@ suggest_to_connect (const struct GNUNET_PeerIdentity *pid, const char *address)
                 "Cannot connect to %s at `%s', no matching communicator present\n",
                 GNUNET_i2s (pid),
                 address);
+    GNUNET_free (prefix);
     return;
   }
   /* forward suggestion for queue creation to communicator */
@@ -9198,6 +9206,7 @@ suggest_to_connect (const struct GNUNET_PeerIdentity *pid, const char *address)
               (unsigned int) idgen,
               prefix,
               address);
+  GNUNET_free (prefix);
   alen = strlen (address) + 1;
   env =
     GNUNET_MQ_msg_extra (cqm, alen, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE);
index fa977a3646e6723e4227c8f4b3c913533f28da9b..98f1170ff5e1c7ca284ff4572de1cd71bdb6fec9 100644 (file)
@@ -93,9 +93,7 @@ stat_start_attempt_cb (void *cls,
   struct PeerStats *stat = cls;
 
   stat->switch_attempts++;
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Switch attempted (%p)",
-              stat);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Switch attempted (%p)", stat);
   bytes_recv_after_switch = 0;
   bytes_sent_after_switch = 0;
 
@@ -113,9 +111,7 @@ stat_success_attempt_cb (void *cls,
   struct PeerStats *stat = cls;
 
   stat->switch_success++;
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Switch succeeded (%p)",
-              stat);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Switch succeeded (%p)", stat);
   return GNUNET_OK;
 }
 
@@ -133,9 +129,7 @@ stat_fail_attempt_cb (void *cls,
     return GNUNET_OK;
 
   stat->switch_fail++;
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "Switch failed (%p)",
-              stat);
+  GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Switch failed (%p)", stat);
   return GNUNET_OK;
 }
 
@@ -157,7 +151,8 @@ stat_addresses_available (void *cls,
 /**
  * List of statistics entries we care about.
  */
-static struct WatchEntry {
+static struct WatchEntry
+{
 
   /**
    * Name of the statistic we watch.
@@ -168,15 +163,17 @@ static struct WatchEntry {
    * Handler to register;
    */
   GNUNET_STATISTICS_Iterator stat_handler;
-} watches[] = {
-  { "# Attempts to switch addresses", &stat_start_attempt_cb },
-  { "# Successful attempts to switch addresses", &stat_success_attempt_cb },
-  { "# Failed attempts to switch addresses (failed to send CONNECT CONT)", &stat_fail_attempt_cb },
-  { "# Failed attempts to switch addresses (failed to send CONNECT)", &stat_fail_attempt_cb },
-  { "# Failed attempts to switch addresses (no response)", &stat_fail_attempt_cb },
-  { "# transport addresses", &stat_addresses_available },
-  { NULL, NULL }
-};
+} watches[] =
+  {{"# Attempts to switch addresses", &stat_start_attempt_cb},
+   {"# Successful attempts to switch addresses", &stat_success_attempt_cb},
+   {"# Failed attempts to switch addresses (failed to send CONNECT CONT)",
+    &stat_fail_attempt_cb},
+   {"# Failed attempts to switch addresses (failed to send CONNECT)",
+    &stat_fail_attempt_cb},
+   {"# Failed attempts to switch addresses (no response)",
+    &stat_fail_attempt_cb},
+   {"# transport addresses", &stat_addresses_available},
+   {NULL, NULL}};
 
 
 static void
@@ -203,19 +200,18 @@ custom_shutdown (void *cls)
   }
 
   /* stop statistics */
-  for (unsigned int i=0;i<2;i++)
+  for (unsigned int i = 0; i < 2; i++)
   {
     if (NULL != stats[i].stat)
     {
-      for (unsigned int j=0;NULL != watches[j].stat_name; j++)
-        GNUNET_STATISTICS_watch_cancel (stats[i].stat,
-                                        "transport",
-                                        watches[j].stat_name,
-                                        watches[j].stat_handler,
-                                        &stats[i]);
-
-      GNUNET_STATISTICS_destroy (stats[i].stat,
-                                 GNUNET_NO);
+      for (unsigned int j = 0; NULL != watches[j].stat_name; j++)
+        GNUNET_assert (GNUNET_OK ==
+                       GNUNET_STATISTICS_watch_cancel (stats[i].stat,
+                                                       "transport",
+                                                       watches[j].stat_name,
+                                                       watches[j].stat_handler,
+                                                       &stats[i]));
+      GNUNET_STATISTICS_destroy (stats[i].stat, GNUNET_NO);
       stats[i].stat = NULL;
     }
   }
@@ -224,15 +220,16 @@ custom_shutdown (void *cls)
   FPRINTF (stderr, "\n");
   if (stats[0].switch_attempts > 0)
   {
-    FPRINTF (stderr,
-             "Peer 1 tried %u times to switch and succeeded %u times, failed %u times\n",
-             stats[0].switch_attempts,
-             stats[0].switch_success,
-             stats[0].switch_fail);
+    FPRINTF (
+      stderr,
+      "Peer 1 tried %u times to switch and succeeded %u times, failed %u times\n",
+      stats[0].switch_attempts,
+      stats[0].switch_success,
+      stats[0].switch_fail);
     if (stats[0].switch_success != stats[0].switch_attempts)
     {
       GNUNET_break (0);
-      result ++;
+      result++;
     }
   }
   else if (stats[0].addresses_avail > 1)
@@ -243,11 +240,12 @@ custom_shutdown (void *cls)
   }
   if (stats[1].switch_attempts > 0)
   {
-    FPRINTF (stderr,
-             "Peer 2 tried %u times to switch and succeeded %u times, failed %u times\n",
-             stats[1].switch_attempts,
-             stats[1].switch_success,
-             stats[1].switch_fail);
+    FPRINTF (
+      stderr,
+      "Peer 2 tried %u times to switch and succeeded %u times, failed %u times\n",
+      stats[1].switch_attempts,
+      stats[1].switch_success,
+      stats[1].switch_fail);
     if (stats[1].switch_success != stats[1].switch_attempts)
     {
       GNUNET_break (0);
@@ -261,19 +259,17 @@ custom_shutdown (void *cls)
              stats[1].addresses_avail);
   }
 
-  if ( ((stats[0].switch_attempts > 0) || (stats[1].switch_attempts > 0)) &&
-       (bytes_sent_after_switch == 0) )
+  if (((stats[0].switch_attempts > 0) || (stats[1].switch_attempts > 0)) &&
+      (bytes_sent_after_switch == 0))
   {
-    FPRINTF (stderr,
-            "No data sent after switching!\n");
+    FPRINTF (stderr, "No data sent after switching!\n");
     GNUNET_break (0);
     result++;
   }
-  if ( ((stats[0].switch_attempts > 0) || (stats[1].switch_attempts > 0)) &&
-       (bytes_recv_after_switch == 0) )
+  if (((stats[0].switch_attempts > 0) || (stats[1].switch_attempts > 0)) &&
+      (bytes_recv_after_switch == 0))
   {
-    FPRINTF (stderr,
-            "No data received after switching!\n");
+    FPRINTF (stderr, "No data received after switching!\n");
     GNUNET_break (0);
     result++;
   }
@@ -306,13 +302,14 @@ notify_receive (void *cls,
                 GNUNET_i2s (sender));
     GNUNET_free (ps);
   }
-  if ( ((stats[0].switch_attempts >= 1) || (stats[1].switch_attempts >= 1)) &&
-        (stats[0].switch_attempts == stats[0].switch_fail + stats[0].switch_success) &&
-        (stats[1].switch_attempts == stats[1].switch_fail + stats[1].switch_success) )
+  if (((stats[0].switch_attempts >= 1) || (stats[1].switch_attempts >= 1)) &&
+      (stats[0].switch_attempts ==
+       stats[0].switch_fail + stats[0].switch_success) &&
+      (stats[1].switch_attempts ==
+       stats[1].switch_fail + stats[1].switch_success))
   {
-    bytes_recv_after_switch += ntohs(hdr->header.size);
-    if ( (bytes_sent_after_switch > 0) &&
-        (bytes_recv_after_switch > 0) )
+    bytes_recv_after_switch += ntohs (hdr->header.size);
+    if ((bytes_sent_after_switch > 0) && (bytes_recv_after_switch > 0))
     {
       /* A peer switched addresses and sent and received data after the
        * switch operations */
@@ -327,21 +324,22 @@ notify_send (void *cls)
 {
   static uint32_t cnt;
 
-  GNUNET_assert (GNUNET_OK ==
-                GNUNET_TRANSPORT_TESTING_send (ccc->p[1],
-                                               ccc->p[0],
-                                               GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
-                                               GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE,
-                                               ++cnt,
-                                               &notify_send,
-                                               NULL));
-  if ( ( (stats[0].switch_attempts >= 1) ||
-         (stats[1].switch_attempts >= 1) ) &&
-       (stats[0].switch_attempts == stats[0].switch_fail + stats[0].switch_success) &&
-       (stats[1].switch_attempts == stats[1].switch_fail + stats[1].switch_success) )
+  GNUNET_assert (
+    GNUNET_OK ==
+    GNUNET_TRANSPORT_TESTING_send (ccc->p[1],
+                                   ccc->p[0],
+                                   GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
+                                   GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE,
+                                   ++cnt,
+                                   &notify_send,
+                                   NULL));
+  if (((stats[0].switch_attempts >= 1) || (stats[1].switch_attempts >= 1)) &&
+      (stats[0].switch_attempts ==
+       stats[0].switch_fail + stats[0].switch_success) &&
+      (stats[1].switch_attempts ==
+       stats[1].switch_fail + stats[1].switch_success))
   {
-    bytes_sent_after_switch
-      += GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE;
+    bytes_sent_after_switch += GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE;
   }
 }
 
@@ -370,10 +368,9 @@ progress_indicator (void *cls)
 static void
 connected_cb (void *cls)
 {
-  for (unsigned int i=0;i<2;i++)
+  for (unsigned int i = 0; i < 2; i++)
   {
-    stats[i].stat = GNUNET_STATISTICS_create ("transport",
-                                              ccc->p[i]->cfg);
+    stats[i].stat = GNUNET_STATISTICS_create ("transport", ccc->p[i]->cfg);
     if (NULL == stats[i].stat)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -382,7 +379,7 @@ connected_cb (void *cls)
       GNUNET_SCHEDULER_shutdown ();
       return;
     }
-    for (unsigned int j=0;NULL != watches[j].stat_name; j++)
+    for (unsigned int j = 0; NULL != watches[j].stat_name; j++)
     {
       GNUNET_STATISTICS_watch (stats[i].stat,
                                "transport",
@@ -397,29 +394,28 @@ connected_cb (void *cls)
                                                &progress_indicator,
                                                NULL);
   /* Peers are connected, start transmit test messages */
-  GNUNET_assert (GNUNET_OK ==
-                GNUNET_TRANSPORT_TESTING_send (ccc->p[1],
-                                               ccc->p[0],
-                                               GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
-                                               GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE,
-                                               0,
-                                               &notify_send,
-                                               NULL));
+  GNUNET_assert (
+    GNUNET_OK ==
+    GNUNET_TRANSPORT_TESTING_send (ccc->p[1],
+                                   ccc->p[0],
+                                   GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
+                                   GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE,
+                                   0,
+                                   &notify_send,
+                                   NULL));
 }
 
 
 int
-main (int argc,
-      char *argv[])
+main (int argc, char *argv[])
 {
-  struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext my_ccc = {
-    .connect_continuation = &connected_cb,
-    .config_file = "test_transport_api_data.conf",
-    .rec = &notify_receive,
-    .nc = &GNUNET_TRANSPORT_TESTING_log_connect,
-    .shutdown_task = &custom_shutdown,
-    .timeout = TIMEOUT
-  };
+  struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext my_ccc =
+    {.connect_continuation = &connected_cb,
+     .config_file = "test_transport_api_data.conf",
+     .rec = &notify_receive,
+     .nc = &GNUNET_TRANSPORT_TESTING_log_connect,
+     .shutdown_task = &custom_shutdown,
+     .timeout = TIMEOUT};
   ccc = &my_ccc;
   int ret;