Fixed comparison to get correct timeout values
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 26 Oct 2010 16:24:50 +0000 (16:24 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 26 Oct 2010 16:24:50 +0000 (16:24 +0000)
th->timeout is absolut value, duration was relative, so comparison was never true

src/transport/transport_api.c

index 0ea1705ae68e916ed19609b00e6f4c9927ae58c7..f1c0657802d7b5f3c59eeb349a8549d6785829bd 100644 (file)
@@ -464,7 +464,8 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h)
       /* check outgoing quota */
       duration = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker,
                                                     th->notify_size - sizeof (struct OutboundMessage));
-      if (th->timeout.value < duration.value)
+      struct GNUNET_TIME_Absolute duration_abs = GNUNET_TIME_relative_to_absolute (duration);
+      if (th->timeout.value < duration_abs.value)
        {
          /* signal timeout! */
 #if DEBUG_TRANSPORT