aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-10-27 10:04:42 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-10-27 10:04:42 +0000
commitf47cc990ea9a89cb39acc9c6a9789e6474197708 (patch)
treef8301a2b5405ed692592fb98c94d53dc4a9c9151 /src/transport/transport_api.c
parentabcb868988fd2d754e13ef5122c8ada9c404b273 (diff)
downloadgnunet-f47cc990ea9a89cb39acc9c6a9789e6474197708.tar.gz
gnunet-f47cc990ea9a89cb39acc9c6a9789e6474197708.zip
Refactoring gnunet time
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r--src/transport/transport_api.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index f1c065780..53330d39e 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -465,13 +465,13 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h)
465 duration = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, 465 duration = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker,
466 th->notify_size - sizeof (struct OutboundMessage)); 466 th->notify_size - sizeof (struct OutboundMessage));
467 struct GNUNET_TIME_Absolute duration_abs = GNUNET_TIME_relative_to_absolute (duration); 467 struct GNUNET_TIME_Absolute duration_abs = GNUNET_TIME_relative_to_absolute (duration);
468 if (th->timeout.value < duration_abs.value) 468 if (th->timeout.abs_value < duration_abs.abs_value)
469 { 469 {
470 /* signal timeout! */ 470 /* signal timeout! */
471#if DEBUG_TRANSPORT 471#if DEBUG_TRANSPORT
472 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 472 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
473 "Would need %llu ms before bandwidth is available for delivery to `%4s', that is too long. Signaling timeout.\n", 473 "Would need %llu ms before bandwidth is available for delivery to `%4s', that is too long. Signaling timeout.\n",
474 duration.value, 474 duration.abs_value,
475 GNUNET_i2s (&n->id)); 475 GNUNET_i2s (&n->id));
476#endif 476#endif
477 if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) 477 if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
@@ -484,7 +484,7 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h)
484 GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); 484 GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
485 continue; 485 continue;
486 } 486 }
487 if (duration.value > 0) 487 if (duration.rel_value > 0)
488 { 488 {
489#if DEBUG_TRANSPORT 489#if DEBUG_TRANSPORT
490 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 490 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -492,7 +492,7 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h)
492 (unsigned int) n->out_tracker.available_bytes_per_s__, 492 (unsigned int) n->out_tracker.available_bytes_per_s__,
493 (unsigned int) th->notify_size - sizeof (struct OutboundMessage), 493 (unsigned int) th->notify_size - sizeof (struct OutboundMessage),
494 GNUNET_i2s (&n->id), 494 GNUNET_i2s (&n->id),
495 duration.value); 495 duration.abs_value);
496#endif 496#endif
497 retry_time = GNUNET_TIME_relative_min (retry_time, 497 retry_time = GNUNET_TIME_relative_min (retry_time,
498 duration); 498 duration);
@@ -608,7 +608,7 @@ transport_notify_ready (void *cls, size_t size, void *buf)
608 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 608 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
609 "Message of %u bytes with timeout %llums constructed for `%4s'\n", 609 "Message of %u bytes with timeout %llums constructed for `%4s'\n",
610 (unsigned int) mret, 610 (unsigned int) mret,
611 (unsigned long long) GNUNET_TIME_absolute_get_remaining (th->timeout).value, 611 (unsigned long long) GNUNET_TIME_absolute_get_remaining (th->timeout).abs_value,
612 GNUNET_i2s (&n->id)); 612 GNUNET_i2s (&n->id));
613#endif 613#endif
614 if (mret != 0) 614 if (mret != 0)
@@ -755,7 +755,7 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h,
755#if DEBUG_TRANSPORT 755#if DEBUG_TRANSPORT
756 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 756 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
757 "Control transmit of %u bytes within %llums requested\n", 757 "Control transmit of %u bytes within %llums requested\n",
758 size, (unsigned long long) timeout.value); 758 size, (unsigned long long) timeout.abs_value);
759#endif 759#endif
760 th = GNUNET_malloc (sizeof (struct ControlMessage)); 760 th = GNUNET_malloc (sizeof (struct ControlMessage));
761 th->h = h; 761 th->h = h;
@@ -1235,14 +1235,14 @@ schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
1235#if DEBUG_TRANSPORT 1235#if DEBUG_TRANSPORT
1236 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1236 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1237 "Scheduling task to reconnect to transport service in %llu ms.\n", 1237 "Scheduling task to reconnect to transport service in %llu ms.\n",
1238 h->reconnect_delay.value); 1238 h->reconnect_delay.abs_value);
1239#endif 1239#endif
1240 GNUNET_assert (h->client == NULL); 1240 GNUNET_assert (h->client == NULL);
1241 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 1241 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
1242 h->reconnect_task 1242 h->reconnect_task
1243 = GNUNET_SCHEDULER_add_delayed (h->sched, 1243 = GNUNET_SCHEDULER_add_delayed (h->sched,
1244 h->reconnect_delay, &reconnect, h); 1244 h->reconnect_delay, &reconnect, h);
1245 if (h->reconnect_delay.value == 0) 1245 if (h->reconnect_delay.rel_value == 0)
1246 { 1246 {
1247 h->reconnect_delay = GNUNET_TIME_UNIT_MILLISECONDS; 1247 h->reconnect_delay = GNUNET_TIME_UNIT_MILLISECONDS;
1248 } 1248 }
@@ -1798,12 +1798,12 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle
1798 GNUNET_break (0); 1798 GNUNET_break (0);
1799 return NULL; 1799 return NULL;
1800 } 1800 }
1801 1801#if DEBUG_TRANSPORT
1802 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1802 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1803 "Asking transport service for transmission of %u bytes to peer `%4s' within %llu ms.\n", 1803 "Asking transport service for transmission of %u bytes to peer `%4s' within %llu ms.\n",
1804 size, GNUNET_i2s (target), 1804 size, GNUNET_i2s (target),
1805 (unsigned long long) timeout.value); 1805 (unsigned long long) timeout.abs_value);
1806 1806#endif
1807 n = neighbour_find (handle, target); 1807 n = neighbour_find (handle, target);
1808 if (n == NULL) 1808 if (n == NULL)
1809 { 1809 {