aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2016-10-26 04:20:47 +0000
committerBart Polot <bart@net.in.tum.de>2016-10-26 04:20:47 +0000
commit3968a7b989f996116e2ddb679482655e25aa20fd (patch)
treee5b1b5a8f50327d4689fa8c0a2c298261bab98bb /src
parenteabdf42783e7ca2c3579c1847f21d178ac52a584 (diff)
downloadgnunet-3968a7b989f996116e2ddb679482655e25aa20fd.tar.gz
gnunet-3968a7b989f996116e2ddb679482655e25aa20fd.zip
- send connection keepalive if tunnel is unable to send traffic yet
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index da0d6e20d..1b8bb1c3e 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1136,6 +1136,7 @@ send_connection_keepalive (struct CadetConnection *c, int fwd)
1136{ 1136{
1137 struct GNUNET_MessageHeader msg; 1137 struct GNUNET_MessageHeader msg;
1138 struct CadetFlowControl *fc; 1138 struct CadetFlowControl *fc;
1139 int tunnel_ready;
1139 1140
1140 GCC_check_connections (); 1141 GCC_check_connections ();
1141 LOG (GNUNET_ERROR_TYPE_INFO, 1142 LOG (GNUNET_ERROR_TYPE_INFO,
@@ -1144,7 +1145,9 @@ send_connection_keepalive (struct CadetConnection *c, int fwd)
1144 1145
1145 GNUNET_assert (NULL != c->t); 1146 GNUNET_assert (NULL != c->t);
1146 fc = fwd ? &c->fwd_fc : &c->bck_fc; 1147 fc = fwd ? &c->fwd_fc : &c->bck_fc;
1147 if (0 < fc->queue_n || GNUNET_YES == GCT_has_queued_traffic (c->t)) 1148 tunnel_ready = GNUNET_YES == GCT_has_queued_traffic (c->t)
1149 && CADET_TUNNEL_KEY_OK <= GCT_get_estate (c->t);
1150 if (0 < fc->queue_n || tunnel_ready)
1148 { 1151 {
1149 LOG (GNUNET_ERROR_TYPE_INFO, "not sending keepalive, traffic in queue\n"); 1152 LOG (GNUNET_ERROR_TYPE_INFO, "not sending keepalive, traffic in queue\n");
1150 return; 1153 return;