gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30059 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r30059 - gnunet/src/mesh
Date: Wed, 9 Oct 2013 18:00:17 +0200

Author: bartpolot
Date: 2013-10-09 18:00:17 +0200 (Wed, 09 Oct 2013)
New Revision: 30059

Modified:
   gnunet/src/mesh/gnunet-service-mesh_channel.c
Log:
- one catch-all ack handles renedered obsolete


Modified: gnunet/src/mesh/gnunet-service-mesh_channel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_channel.c       2013-10-09 15:58:05 UTC 
(rev 30058)
+++ gnunet/src/mesh/gnunet-service-mesh_channel.c       2013-10-09 16:00:17 UTC 
(rev 30059)
@@ -567,74 +567,6 @@
 
 
 /**
- * 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
  * timers and frees all memory.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]