From 3b997bba84a8a11ae5b85c1f23e5f94a1139f7e4 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 27 Nov 2013 04:28:33 +0000 Subject: - fix case of reconnection during valid handshake --- src/mesh/gnunet-service-mesh_tunnel.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 56b27147e..baf39dfd1 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -1528,11 +1528,19 @@ GMT_change_cstate (struct MeshTunnel3* t, enum MeshTunnel3CState state) GMP_2s (t->peer), cstate2s (state)); if (myid != GMP_get_short_id (t->peer) && MESH_TUNNEL3_READY != t->cstate && - MESH_TUNNEL3_READY == state && - MESH_TUNNEL3_KEY_UNINITIALIZED == t->estate) + MESH_TUNNEL3_READY == state) { - LOG (GNUNET_ERROR_TYPE_DEBUG, " triggered rekey\n"); - rekey_tunnel (t, NULL); + t->cstate = state; + if (MESH_TUNNEL3_KEY_OK == t->estate) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, " triggered send queued data\n"); + send_queued_data (t); + } + else if (MESH_TUNNEL3_KEY_UNINITIALIZED == t->estate) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, " triggered rekey\n"); + rekey_tunnel (t, NULL); + } } t->cstate = state; @@ -1710,6 +1718,7 @@ GMT_destroy_empty (struct MeshTunnel3 *t) GMC_send_destroy (iter->c); } + t->cstate = MESH_TUNNEL3_NEW; t->destroy = GNUNET_YES; } -- cgit v1.2.3