From 19bac8a30621850aabff7dd2c0ef2611790b334a Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 11 Jun 2013 16:21:51 +0000 Subject: [PATCH] - fix remaining warnings --- src/mesh/test_mesh2_small.c | 49 ++++++------------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/src/mesh/test_mesh2_small.c b/src/mesh/test_mesh2_small.c index 1ed8a4e9b..25df0c21c 100644 --- a/src/mesh/test_mesh2_small.c +++ b/src/mesh/test_mesh2_small.c @@ -182,11 +182,6 @@ static struct GNUNET_MESH_Tunnel *t; */ static struct GNUNET_MESH_Tunnel *incoming_t; -/** - * Tunnel handle for the second leaf peer - */ -static struct GNUNET_MESH_Tunnel *incoming_t2; - /** * Time we started the data transmission (after tunnel has been established * and initilized). @@ -264,11 +259,6 @@ disconnect_mesh_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_MESH_tunnel_destroy (incoming_t); incoming_t = NULL; } - if (NULL != incoming_t2) - { - GNUNET_MESH_tunnel_destroy (incoming_t2); - incoming_t2 = NULL; - } GNUNET_MESH_TEST_cleanup (test_ctx); if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) { @@ -569,8 +559,6 @@ incoming_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel, GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); if ((long) cls == 4L) incoming_t = tunnel; - else if ((long) cls == 3L) - incoming_t2 = tunnel; else { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -611,10 +599,15 @@ tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, ok++; incoming_t = NULL; } - else if (3L == i) + else if (0L == i && P2P_SIGNAL == test) { - ok++; - incoming_t2 = NULL; + ok ++; + if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) + { + GNUNET_SCHEDULER_cancel (disconnect_task); + } + disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers, + (void *) __LINE__); } else GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -635,32 +628,6 @@ tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, } -/** - * Method called whenever a tunnel falls apart. - * - * @param cls closure - * @param peer peer identity the tunnel stopped working with - */ -static void -dh (void *cls, const struct GNUNET_PeerIdentity *peer) -{ - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "peer %s disconnected\n", - GNUNET_i2s (peer)); - if (P2P_SIGNAL == test) - { - ok ++; - if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) - { - GNUNET_SCHEDULER_cancel (disconnect_task); - } - disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers, - (void *) __LINE__); - } - return; -} - - /** * START THE TESTCASE ITSELF, AS WE ARE CONNECTED TO THE MESH SERVICES. * -- 2.25.1