From 3968a7b989f996116e2ddb679482655e25aa20fd Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 26 Oct 2016 04:20:47 +0000 Subject: [PATCH] - send connection keepalive if tunnel is unable to send traffic yet --- src/cadet/gnunet-service-cadet_connection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { struct GNUNET_MessageHeader msg; struct CadetFlowControl *fc; + int tunnel_ready; GCC_check_connections (); LOG (GNUNET_ERROR_TYPE_INFO, @@ -1144,7 +1145,9 @@ send_connection_keepalive (struct CadetConnection *c, int fwd) GNUNET_assert (NULL != c->t); fc = fwd ? &c->fwd_fc : &c->bck_fc; - if (0 < fc->queue_n || GNUNET_YES == GCT_has_queued_traffic (c->t)) + tunnel_ready = GNUNET_YES == GCT_has_queued_traffic (c->t) + && CADET_TUNNEL_KEY_OK <= GCT_get_estate (c->t); + if (0 < fc->queue_n || tunnel_ready) { LOG (GNUNET_ERROR_TYPE_INFO, "not sending keepalive, traffic in queue\n"); return; -- 2.25.1