From 8f9b85786d6c1dca1b5a9b03c64c5366db597df7 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 15 Dec 2014 07:18:03 +0000 Subject: [PATCH] - send queued data the first time --- src/cadet/gnunet-service-cadet_tunnel.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 14d8b1d11..554b1d1b9 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -2234,22 +2234,24 @@ GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate) void GCT_change_estate (struct CadetTunnel* t, enum CadetTunnelEState state) { + enum CadetTunnelEState old; + if (NULL == t) return; + old = t->estate; + t->estate = state; LOG (GNUNET_ERROR_TYPE_DEBUG, "Tunnel %s estate was %s\n", - GCP_2s (t->peer), estate2s (t->estate)); + GCP_2s (t->peer), estate2s (old)); LOG (GNUNET_ERROR_TYPE_DEBUG, "Tunnel %s estate is now %s\n", - GCP_2s (t->peer), estate2s (state)); + GCP_2s (t->peer), estate2s (t->estate)); /* Send queued data if enc state changes to OK */ if (myid != GCP_get_short_id (t->peer) && - CADET_TUNNEL_KEY_OK != t->estate && CADET_TUNNEL_KEY_OK == state) + CADET_TUNNEL_KEY_OK != old && CADET_TUNNEL_KEY_OK == t->estate) { send_queued_data (t); } - - t->estate = state; } -- 2.25.1