diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-09-05 03:36:22 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-09-05 03:36:22 +0000 |
commit | 729672a9ed4f6946fb867da17beef945f4b15b63 (patch) | |
tree | 85757c7b89b485cbe58c3a1956f2af59f8d7eed8 | |
parent | 3a682d79308224dbb6ea46300f5ca1766eac9422 (diff) | |
download | gnunet-729672a9ed4f6946fb867da17beef945f4b15b63.tar.gz gnunet-729672a9ed4f6946fb867da17beef945f4b15b63.zip |
- use queue, not ack, for buffer size calculation
-rw-r--r-- | src/mesh/gnunet-service-mesh-enc.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) | |||
1719 | 1719 | ||
1720 | /** | 1720 | /** |
1721 | * Get the total buffer space for a tunnel. | 1721 | * Get the total buffer space for a tunnel. |
1722 | * | ||
1723 | * @param t Tunnel. | ||
1724 | * @param fwd Is this for FWD traffic? | ||
1725 | * | ||
1726 | * @return Buffer space offered by all connections in the tunnel. | ||
1722 | */ | 1727 | */ |
1723 | static unsigned int | 1728 | static unsigned int |
1724 | tunnel_get_buffer (struct MeshTunnel2 *t, int fwd) | 1729 | tunnel_get_buffer (struct MeshTunnel2 *t, int fwd) |
@@ -1764,7 +1769,7 @@ tunnel_get_buffer (struct MeshTunnel2 *t, int fwd) | |||
1764 | } | 1769 | } |
1765 | 1770 | ||
1766 | fc = fwd ? &c->fwd_fc : &c->bck_fc; | 1771 | fc = fwd ? &c->fwd_fc : &c->bck_fc; |
1767 | buffer += fc->last_ack_recv - fc->last_pid_sent; | 1772 | buffer += fc->queue_max - fc->queue_n; |
1768 | c = c->next; | 1773 | c = c->next; |
1769 | } | 1774 | } |
1770 | 1775 | ||