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));
}
}
{
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);
}
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 --;
_("Disconnected from"),
GNUNET_i2s (peer),
monitor_connections_counter);
- GNUNET_free (now_str);
}
}
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);