aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-06-10 12:08:19 +0000
committerBart Polot <bart@net.in.tum.de>2015-06-10 12:08:19 +0000
commit43ed712bb791696cbcb80be93971879cdb4b2dfc (patch)
tree51f5b8f6bfa36c7d8af1554ff3788ae6912742cb /src
parentf93036732d675cb98c6e2f9064732d7e03a043e5 (diff)
downloadgnunet-43ed712bb791696cbcb80be93971879cdb4b2dfc.tar.gz
gnunet-43ed712bb791696cbcb80be93971879cdb4b2dfc.zip
Always allow a connection to receive data in a tunnel, even if all buffers are full: new channels and keepalives must be allowed.
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 661a056b6..fc095bfdd 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -43,6 +43,7 @@
43#define DUMP_KEYS_TO_STDERR GNUNET_NO 43#define DUMP_KEYS_TO_STDERR GNUNET_NO
44#endif 44#endif
45 45
46#define MIN_TUNNEL_BUFFER 8
46#define MAX_SKIPPED_KEYS 64 47#define MAX_SKIPPED_KEYS 64
47#define MAX_KEY_GAP 256 48#define MAX_KEY_GAP 256
48#define AX_HEADER_SIZE (sizeof (uint32_t) * 2\ 49#define AX_HEADER_SIZE (sizeof (uint32_t) * 2\
@@ -3876,7 +3877,7 @@ GCT_get_channels_buffer (struct CadetTunnel *t)
3876 { 3877 {
3877 /* Probably getting buffer for a channel create/handshake. */ 3878 /* Probably getting buffer for a channel create/handshake. */
3878 LOG (GNUNET_ERROR_TYPE_DEBUG, " no channels, allow max\n"); 3879 LOG (GNUNET_ERROR_TYPE_DEBUG, " no channels, allow max\n");
3879 return 64; 3880 return MIN_TUNNEL_BUFFER;
3880 } 3881 }
3881 3882
3882 buffer = 0; 3883 buffer = 0;
@@ -3886,6 +3887,8 @@ GCT_get_channels_buffer (struct CadetTunnel *t)
3886 if (ch_buf > buffer) 3887 if (ch_buf > buffer)
3887 buffer = ch_buf; 3888 buffer = ch_buf;
3888 } 3889 }
3890 if (MIN_TUNNEL_BUFFER > buffer)
3891 return MIN_TUNNEL_BUFFER;
3889 return buffer; 3892 return buffer;
3890} 3893}
3891 3894