From ac74ce5a331f52195950d96c8e761be2d705b19c Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 9 Oct 2013 16:00:17 +0000 Subject: [PATCH] - one catch-all ack handles renedered obsolete --- src/mesh/gnunet-service-mesh_channel.c | 68 -------------------------- 1 file changed, 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 @@ -566,74 +566,6 @@ channel_retransmit_message (void *cls, } -/** - * Send ACK on one or more connections due to buffer space to the client. - * - * Iterates all connections of the tunnel and sends ACKs appropriately. - * - * @param ch Channel which has some free buffer space. - * @param fwd Is this in for FWD traffic? (ACK goes dest->root) - */ -static void -channel_send_connections_ack (struct MeshChannel *ch, - unsigned int buffer, - int fwd) -{ - struct MeshTunnel3 *t = ch->t; - struct MeshConnection *c; - uint32_t allowed; - uint32_t to_allow; - uint32_t allow_per_connection; - unsigned int cs; - - LOG (GNUNET_ERROR_TYPE_DEBUG, - "Channel send connection %s ack on %s:%X\n", - fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid); - - /* Count connections, how many messages are already allowed */ - cs = GMT_count_connections (t); - for (cs = 0, allowed = 0, c = t->connection_head; NULL != c; c = c->next) - { - fc = fwd ? &c->fwd_fc : &c->bck_fc; - if (GMC_is_pid_bigger (fc->last_pid_recv, fc->last_ack_sent)) - { - GNUNET_break (0); - continue; - } - allowed += fc->last_ack_sent - fc->last_pid_recv; - cs++; - } - - /* Make sure there is no overflow */ - if (allowed > buffer) - { - GNUNET_break (0); - return; - } - - /* Authorize connections to send more data */ - to_allow = buffer - allowed; - - for (c = t->connection_head; NULL != c && to_allow > 0; c = c->next) - { - allow_per_connection = to_allow/cs; - to_allow -= allow_per_connection; - cs--; - fc = fwd ? &c->fwd_fc : &c->bck_fc; - if (fc->last_ack_sent - fc->last_pid_recv > 64 / 3) - { - continue; - } - GMC_send_ack (c, allow_per_connection, fwd); - } - - LOG (GNUNET_ERROR_TYPE_DEBUG, - "Channel send connection %s ack on %s:%X\n", - fwd ? "FWD" : "BCK", GMT_2s (ch->t), ch->gid); - GNUNET_break (to_allow == 0); -} - - /** * Destroy a reliable message after it has been acknowledged, either by * direct mid ACK or bitfield. Updates the appropriate data structures and -- 2.25.1