[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r23261 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r23261 - gnunet/src/mesh |
Date: |
Thu, 16 Aug 2012 16:44:30 +0200 |
Author: bartpolot
Date: 2012-08-16 16:44:30 +0200 (Thu, 16 Aug 2012)
New Revision: 23261
Modified:
gnunet/src/mesh/gnunet-service-mesh.c
Log:
- cleanup flow control code
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2012-08-16 14:38:18 UTC (rev
23260)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2012-08-16 14:44:30 UTC (rev
23261)
@@ -1073,16 +1073,6 @@
static uint32_t
tunnel_get_fwd_ack (struct MeshTunnel *t);
-/**
- * Get the current ack value for a tunnel, for data going from leaves to root,
- * taking in account the tunnel mode and the status of all children and
clients.
- *
- * @param t Tunnel.
- *
- * @return Maximum PID allowed.
- */
-static uint32_t
-tunnel_get_bck_ack (struct MeshTunnel *t);
/**
* Add a client to a tunnel, initializing all needed data structures.
@@ -2040,51 +2030,6 @@
/**
- * Notify a client of a tunnel about how many more
- * payload packages will we accept on a given tunnel,
- * distinguishing between root and leaf clients.
- *
- * @param c Client whom to send the ACK.
- * @param t Tunnel on which to send the ACK.
- */
-static void
-send_client_tunnel_ack (struct MeshClient *c, struct MeshTunnel *t)
-{
- MESH_TunnelNumber tid;
- uint32_t ack;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending client ACK on tunnel %X\n",
- t->local_tid);
- if (NULL == c)
- return;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " to client %u\n", c->id);
-
- if (c == t->owner)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " (owner, FWD ACK)\n");
- ack = tunnel_get_fwd_ack (t);
- tid = t->local_tid;
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " (leaf, BCK ACK)\n");
- ack = tunnel_get_bck_ack (t);
- tid = t->local_tid_dest;
- }
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " ack %u\n", ack);
- if (t->last_fwd_ack == ack)
- return;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending!\n");
- t->last_fwd_ack = ack;
- send_local_ack (t, c, ack);
-}
-
-
-/**
* Notify all clients (not depending on registration status) that the incoming
* tunnel is no longer valid.
*
@@ -3626,37 +3571,7 @@
return ack;
}
-/**
- * Get the current bck ack value for a tunnel, taking in account the tunnel
- * mode and the status of all children nodes.
- *
- * @param t Tunnel.
- *
- * @return Maximum PID allowed.
- */
-static uint32_t
-tunnel_get_bck_ack (struct MeshTunnel *t)
-{
- uint32_t ack;
- if (GNUNET_YES == t->nobuffer)
- {
- if (t->bck_ack > t->bck_pid)
- {
- return t->bck_pid + 1;
- }
- else
- {
- return t->bck_pid;
- }
- }
- ack = t->bck_pid + t->bck_queue_max - t->bck_queue_n;
-
- // FIXME fc
- return ack;
-}
-
-
/**
* Build a local ACK message and send it to a local client.
*
@@ -3702,6 +3617,33 @@
/**
+ * Notify a the owner of a tunnel about how many more
+ * payload packages will we accept on a given tunnel.
+ *
+ * @param t Tunnel on which to send the ACK.
+ */
+static void
+tunnel_send_client_fwd_ack (struct MeshTunnel *t)
+{
+ uint32_t ack;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Sending client FWD ACK on tunnel %X\n",
+ t->local_tid);
+
+ ack = tunnel_get_fwd_ack (t);
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " ack %u\n", ack);
+ if (t->last_fwd_ack == ack)
+ return;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending!\n");
+ t->last_fwd_ack = ack;
+ send_local_ack (t, t->owner, ack);
+}
+
+
+/**
* Send an ACK informing the predecessor about the available buffer space.
* In case there is no predecessor, inform the owning client.
* If buffering is off, send only on behalf of children or self if endpoint.
@@ -3720,7 +3662,7 @@
if (NULL != t->owner)
{
- send_client_tunnel_ack (t->owner, t);
+ tunnel_send_client_fwd_ack (t);
return;
}
/* Is it after unicast / multicast retransmission? */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r23261 - gnunet/src/mesh,
gnunet <=