new operation queue for limiting overlay connects
[oweals/gnunet.git] / src / transport / gnunet-transport.c
index 36c02014ebf3ef234e37562f246420a2218db7dc..5978de6bbc30d014c1373a3ffa3432ccfc1252c0 100644 (file)
@@ -325,16 +325,17 @@ do_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   if (benchmark_receive)
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
-    FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %llu ms)\n"),
+    FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %s)\n"),
              1000 * traffic_received / (1 + duration.rel_value),
-             traffic_received, (unsigned long long) duration.rel_value);
+             traffic_received,
+            GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
   }
   if (benchmark_send)
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
-    FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %llu ms)\n"),
+    FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %s)\n"),
              1000 * traffic_sent / (1 + duration.rel_value), traffic_sent,
-             (unsigned long long) duration.rel_value);
+             GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
   }
 }
 
@@ -447,14 +448,13 @@ monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
 {
   monitor_connections_counter ++;
   struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
-  char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
+  const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
+
   FPRINTF (stdout, _("%24s: %-17s %4s   (%u connections in total)\n"),
            now_str,
            _("Connected to"),
            GNUNET_i2s (peer),
            monitor_connections_counter);
-
-  GNUNET_free (now_str);
 }
 
 
@@ -469,7 +469,7 @@ static void
 monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
 {
   struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
-  char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
+  const char *now_str = GNUNET_STRINGS_absolute_time_to_string (now);
 
   GNUNET_assert (monitor_connections_counter > 0);
   monitor_connections_counter --;
@@ -479,7 +479,6 @@ monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
            _("Disconnected from"),
            GNUNET_i2s (peer),
            monitor_connections_counter);
-  GNUNET_free (now_str);
 }
 
 
@@ -656,7 +655,7 @@ testservice_task (void *cls,
   }
   if (iterate_connections)
   {
-    peers = GNUNET_CONTAINER_multihashmap_create (20);
+    peers = GNUNET_CONTAINER_multihashmap_create (20, GNUNET_NO);
     GNUNET_TRANSPORT_peer_get_active_addresses (cfg, NULL, GNUNET_YES,
                                                 TIMEOUT,
                                                 &process_address, (void *) cfg);