From 729672a9ed4f6946fb867da17beef945f4b15b63 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 5 Sep 2013 03:36:22 +0000 Subject: [PATCH] - use queue, not ack, for buffer size calculation --- src/mesh/gnunet-service-mesh-enc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c index d1a8970f8..06de8f70c 100644 --- a/src/mesh/gnunet-service-mesh-enc.c +++ b/src/mesh/gnunet-service-mesh-enc.c @@ -1719,6 +1719,11 @@ connection_get_buffer (struct MeshConnection *c, int fwd) /** * Get the total buffer space for a tunnel. + * + * @param t Tunnel. + * @param fwd Is this for FWD traffic? + * + * @return Buffer space offered by all connections in the tunnel. */ static unsigned int tunnel_get_buffer (struct MeshTunnel2 *t, int fwd) @@ -1764,7 +1769,7 @@ tunnel_get_buffer (struct MeshTunnel2 *t, int fwd) } fc = fwd ? &c->fwd_fc : &c->bck_fc; - buffer += fc->last_ack_recv - fc->last_pid_sent; + buffer += fc->queue_max - fc->queue_n; c = c->next; } -- 2.25.1