aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api_new.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-06-05 12:31:10 +0000
committerChristian Grothoff <christian@grothoff.org>2011-06-05 12:31:10 +0000
commitd8dc57a9aafa0bfa3669e84a5a09a8feeed63e68 (patch)
tree8e18e80840eb5c9548a55307eae7087b4d674c71 /src/transport/transport_api_new.c
parent70807d6bb9099b1dadc946b93ec7d726e2b249b4 (diff)
downloadgnunet-d8dc57a9aafa0bfa3669e84a5a09a8feeed63e68.tar.gz
gnunet-d8dc57a9aafa0bfa3669e84a5a09a8feeed63e68.zip
fix
Diffstat (limited to 'src/transport/transport_api_new.c')
-rw-r--r--src/transport/transport_api_new.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/transport/transport_api_new.c b/src/transport/transport_api_new.c
index 5ec5cb6d1..86cf7f175 100644
--- a/src/transport/transport_api_new.c
+++ b/src/transport/transport_api_new.c
@@ -625,6 +625,7 @@ transport_notify_ready (void *cls, size_t size, void *buf)
625 struct GNUNET_TRANSPORT_TransmitHandle *th; 625 struct GNUNET_TRANSPORT_TransmitHandle *th;
626 struct Neighbour *n; 626 struct Neighbour *n;
627 char *cbuf; 627 char *cbuf;
628 struct GNUNET_TIME_Relative delay;
628 struct OutboundMessage obm; 629 struct OutboundMessage obm;
629 size_t ret; 630 size_t ret;
630 size_t nret; 631 size_t nret;
@@ -676,7 +677,15 @@ transport_notify_ready (void *cls, size_t size, void *buf)
676 } 677 }
677 th = n->th; 678 th = n->th;
678 if (th->notify_size + sizeof (struct OutboundMessage) > size) 679 if (th->notify_size + sizeof (struct OutboundMessage) > size)
679 break; /* does not fit */ 680 {
681 delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, size);
682 if (delay.rel_value > GNUNET_TIME_absolute_get_remaining (n->th->timeout).rel_value)
683 delay.rel_value = 0; /* notify immediately (with failure) */
684 n->hn = GNUNET_CONTAINER_heap_insert (h->ready_heap,
685 n,
686 delay.rel_value);
687 break; /* does not fit */
688 }
680 n->th = NULL; 689 n->th = NULL;
681 n->is_ready = GNUNET_NO; 690 n->is_ready = GNUNET_NO;
682 GNUNET_assert (size >= sizeof (struct OutboundMessage)); 691 GNUNET_assert (size >= sizeof (struct OutboundMessage));