aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-12-15 07:18:03 +0000
committerBart Polot <bart@net.in.tum.de>2014-12-15 07:18:03 +0000
commit8f9b85786d6c1dca1b5a9b03c64c5366db597df7 (patch)
tree35f1f34de070fc387a2a52d59e208571558c232a /src/cadet
parent1f39de8b391b77e1da35cfcad3db0ad40e506d80 (diff)
- send queued data the first time
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 14d8b1d118..554b1d1b9f 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;
}