dhtlog updates
[oweals/gnunet.git] / src / dv / test_transport_api_dv.c
index 8157d00e75c6a6119ab7287ed7e597d0508a0739..2449663007ee8bfcf2cd9e869f6fdaa92c076aa5 100644 (file)
@@ -198,7 +198,6 @@ finish_testing ()
   struct PeerContext *free_peer_pos;
   struct TestMessageContext *pos;
   struct TestMessageContext *free_pos;
-  int count;
 
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -215,7 +214,6 @@ finish_testing ()
     }
   all_peers = NULL;
 
-  count = 0;
   pos = test_messages;
   while (pos != NULL)
     {
@@ -534,14 +532,14 @@ init_notify_peer1 (void *cls,
    * Connect to the receiving peer
    */
   pos->peer2handle = GNUNET_CORE_connect (sched,
-                       pos->peer2->cfg,
-                       TIMEOUT,
-                       pos,
-                       &init_notify_peer2,
-                       NULL,
-                       NULL,
-                       NULL,
-                       GNUNET_YES, NULL, GNUNET_YES, handlers);
+                                         pos->peer2->cfg,
+                                         TIMEOUT,
+                                         pos,
+                                         &init_notify_peer2,
+                                         NULL,
+                                         NULL,
+                                         NULL, NULL,
+                                         GNUNET_YES, NULL, GNUNET_YES, handlers);
 
 }
 
@@ -578,7 +576,7 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc)
                                           TIMEOUT,
                                           pos,
                                           &init_notify_peer1,
-                                          NULL,
+                                          NULL, NULL,
                                           NULL,
                                           NULL,
                                           GNUNET_NO, NULL, GNUNET_NO, no_handlers);
@@ -834,6 +832,7 @@ static void all_connect_handler (void *cls,
   if (second_daemon == NULL)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Couldn't find second peer!\n");
+      GNUNET_free(second_shortname);
       return;
     }
 #if !TEST_ALL
@@ -893,7 +892,7 @@ peers_started_callback (void *cls,
   GNUNET_assert(GNUNET_SYSERR != GNUNET_CONTAINER_multihashmap_put(peer_daemon_hash, &id->hashPubKey, d, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
 
   new_peer = GNUNET_malloc(sizeof(struct PeerContext));
-  new_peer->peer_handle = GNUNET_CORE_connect(sched, cfg, GNUNET_TIME_UNIT_FOREVER_REL, d, NULL, &all_connect_handler, NULL, NULL, GNUNET_NO, NULL, GNUNET_NO, no_handlers);
+  new_peer->peer_handle = GNUNET_CORE_connect(sched, cfg, GNUNET_TIME_UNIT_FOREVER_REL, d, NULL, &all_connect_handler, NULL, NULL, NULL, GNUNET_NO, NULL, GNUNET_NO, no_handlers);
   new_peer->daemon = d;
   new_peer->next = all_peers;
   all_peers = new_peer;
@@ -1059,6 +1058,7 @@ run (void *cls,
 
   main_cfg = cfg;
 
+  GNUNET_assert(num_peers > 0 && num_peers < (unsigned int)-1);
   peers_left = num_peers;
 
   /* Set up a task to end testing if peer start fails */