diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-08-27 14:51:34 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-08-27 14:51:34 +0000 |
commit | b3bc7b843015205ed9bbf0f08e20d84c7ad5ac7f (patch) | |
tree | d3d0e6cd162aa7ae853333b13a244023b0e50205 /src/mesh | |
parent | 6920692a142da20327b142018782ff0931f2c792 (diff) | |
download | gnunet-b3bc7b843015205ed9bbf0f08e20d84c7ad5ac7f.tar.gz gnunet-b3bc7b843015205ed9bbf0f08e20d84c7ad5ac7f.zip |
- explicitely drop oldest message
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index f301a9a4d..34e4a3681 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -4818,8 +4818,10 @@ queue_add (void *cls, uint16_t type, size_t size, | |||
4818 | i = (cinfo->send_buffer_start + cinfo->send_buffer_n) % t->fwd_queue_max; | 4818 | i = (cinfo->send_buffer_start + cinfo->send_buffer_n) % t->fwd_queue_max; |
4819 | if (NULL != cinfo->send_buffer[i]) | 4819 | if (NULL != cinfo->send_buffer[i]) |
4820 | { | 4820 | { |
4821 | queue_destroy(cinfo->send_buffer[i], GNUNET_YES); | 4821 | GNUNET_break (cinfo->send_buffer_n == t->fwd_queue_max); // aka i == start |
4822 | GNUNET_break (cinfo->send_buffer_n > 0); | 4822 | queue_destroy(cinfo->send_buffer[cinfo->send_buffer_start], GNUNET_YES); |
4823 | cinfo->send_buffer_start++; | ||
4824 | cinfo->send_buffer_start %= t->fwd_queue_max; | ||
4823 | cinfo->send_buffer_n--; | 4825 | cinfo->send_buffer_n--; |
4824 | } | 4826 | } |
4825 | cinfo->send_buffer[i] = queue; | 4827 | cinfo->send_buffer[i] = queue; |