aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-09 16:00:17 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-09 16:00:17 +0000
commitac74ce5a331f52195950d96c8e761be2d705b19c (patch)
treebc4f328b8f3087cda8de95c6f42fabe543d0258b
parent241c68ed20b08309c0eea9c98e21632cb0a8ac69 (diff)
downloadgnunet-ac74ce5a331f52195950d96c8e761be2d705b19c.tar.gz
gnunet-ac74ce5a331f52195950d96c8e761be2d705b19c.zip
- one catch-all ack handles renedered obsolete
-rw-r--r--src/mesh/gnunet-service-mesh_channel.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c
index 8dd8c68e8..ab0927117 100644
--- a/src/mesh/gnunet-service-mesh_channel.c
+++ b/src/mesh/gnunet-service-mesh_channel.c
@@ -567,74 +567,6 @@ channel_retransmit_message (void *cls,
567 567
568 568
569/** 569/**
570 * Send ACK on one or more connections due to buffer space to the client.
571 *
572 * Iterates all connections of the tunnel and sends ACKs appropriately.
573 *
574 * @param ch Channel which has some free buffer space.
575 * @param fwd Is this in for FWD traffic? (ACK goes dest->root)
576 */
577static void
578channel_send_connections_ack (struct MeshChannel *ch,
579 unsigned int buffer,
580 int fwd)
581{
582 struct MeshTunnel3 *t = ch->t;
583 struct MeshConnection *c;
584 uint32_t allowed;
585 uint32_t to_allow;
586 uint32_t allow_per_connection;
587 unsigned int cs;
588
589 LOG (GNUNET_ERROR_TYPE_DEBUG,
590 "Channel send connection %s ack on %s:%X\n",
591 fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid);
592
593 /* Count connections, how many messages are already allowed */
594 cs = GMT_count_connections (t);
595 for (cs = 0, allowed = 0, c = t->connection_head; NULL != c; c = c->next)
596 {
597 fc = fwd ? &c->fwd_fc : &c->bck_fc;
598 if (GMC_is_pid_bigger (fc->last_pid_recv, fc->last_ack_sent))
599 {
600 GNUNET_break (0);
601 continue;
602 }
603 allowed += fc->last_ack_sent - fc->last_pid_recv;
604 cs++;
605 }
606
607 /* Make sure there is no overflow */
608 if (allowed > buffer)
609 {
610 GNUNET_break (0);
611 return;
612 }
613
614 /* Authorize connections to send more data */
615 to_allow = buffer - allowed;
616
617 for (c = t->connection_head; NULL != c && to_allow > 0; c = c->next)
618 {
619 allow_per_connection = to_allow/cs;
620 to_allow -= allow_per_connection;
621 cs--;
622 fc = fwd ? &c->fwd_fc : &c->bck_fc;
623 if (fc->last_ack_sent - fc->last_pid_recv > 64 / 3)
624 {
625 continue;
626 }
627 GMC_send_ack (c, allow_per_connection, fwd);
628 }
629
630 LOG (GNUNET_ERROR_TYPE_DEBUG,
631 "Channel send connection %s ack on %s:%X\n",
632 fwd ? "FWD" : "BCK", GMT_2s (ch->t), ch->gid);
633 GNUNET_break (to_allow == 0);
634}
635
636
637/**
638 * Destroy a reliable message after it has been acknowledged, either by 570 * Destroy a reliable message after it has been acknowledged, either by
639 * direct mid ACK or bitfield. Updates the appropriate data structures and 571 * direct mid ACK or bitfield. Updates the appropriate data structures and
640 * timers and frees all memory. 572 * timers and frees all memory.