h_addr is a define in in netdb.h
[oweals/gnunet.git] / src / transport / gnunet-transport.c
index c03d6a3882c3788baf68b2e4d28fa8a5b779cc0f..f9f6068104e53abef0bd4b8254229dc2ccf86689 100644 (file)
@@ -264,14 +264,14 @@ shutdown_task (void *cls,
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
     FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %s)\n"),
-             1000 * traffic_sent / (1 + duration.rel_value), traffic_sent,
+             1000LL * 1000LL * traffic_sent / (1 + duration.rel_value_us), traffic_sent,
              GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
   }
   if (benchmark_receive)
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
     FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %s)\n"),
-             1000 * traffic_received / (1 + duration.rel_value),
+             1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us),
              traffic_received,
              GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
   }
@@ -487,7 +487,7 @@ transmit_data (void *cls, size_t size, void *buf)
 {
   struct GNUNET_MessageHeader *m = buf;
 
-  if ((NULL == buf) && (0 == size))
+  if ((NULL == buf) || ((NULL == buf) && (0 == size)))
   {
     th = NULL;
     return 0;