aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesh/test_mesh2_small.c49
1 files 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
@@ -183,11 +183,6 @@ static struct GNUNET_MESH_Tunnel *t;
183static struct GNUNET_MESH_Tunnel *incoming_t; 183static struct GNUNET_MESH_Tunnel *incoming_t;
184 184
185/** 185/**
186 * Tunnel handle for the second leaf peer
187 */
188static struct GNUNET_MESH_Tunnel *incoming_t2;
189
190/**
191 * Time we started the data transmission (after tunnel has been established 186 * Time we started the data transmission (after tunnel has been established
192 * and initilized). 187 * and initilized).
193 */ 188 */
@@ -264,11 +259,6 @@ disconnect_mesh_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
264 GNUNET_MESH_tunnel_destroy (incoming_t); 259 GNUNET_MESH_tunnel_destroy (incoming_t);
265 incoming_t = NULL; 260 incoming_t = NULL;
266 } 261 }
267 if (NULL != incoming_t2)
268 {
269 GNUNET_MESH_tunnel_destroy (incoming_t2);
270 incoming_t2 = NULL;
271 }
272 GNUNET_MESH_TEST_cleanup (test_ctx); 262 GNUNET_MESH_TEST_cleanup (test_ctx);
273 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) 263 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
274 { 264 {
@@ -569,8 +559,6 @@ incoming_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
569 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); 559 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
570 if ((long) cls == 4L) 560 if ((long) cls == 4L)
571 incoming_t = tunnel; 561 incoming_t = tunnel;
572 else if ((long) cls == 3L)
573 incoming_t2 = tunnel;
574 else 562 else
575 { 563 {
576 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 564 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -611,10 +599,15 @@ tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel,
611 ok++; 599 ok++;
612 incoming_t = NULL; 600 incoming_t = NULL;
613 } 601 }
614 else if (3L == i) 602 else if (0L == i && P2P_SIGNAL == test)
615 { 603 {
616 ok++; 604 ok ++;
617 incoming_t2 = NULL; 605 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
606 {
607 GNUNET_SCHEDULER_cancel (disconnect_task);
608 }
609 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers,
610 (void *) __LINE__);
618 } 611 }
619 else 612 else
620 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 613 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -636,32 +629,6 @@ tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel,
636 629
637 630
638/** 631/**
639 * Method called whenever a tunnel falls apart.
640 *
641 * @param cls closure
642 * @param peer peer identity the tunnel stopped working with
643 */
644static void
645dh (void *cls, const struct GNUNET_PeerIdentity *peer)
646{
647 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
648 "peer %s disconnected\n",
649 GNUNET_i2s (peer));
650 if (P2P_SIGNAL == test)
651 {
652 ok ++;
653 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
654 {
655 GNUNET_SCHEDULER_cancel (disconnect_task);
656 }
657 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers,
658 (void *) __LINE__);
659 }
660 return;
661}
662
663
664/**
665 * START THE TESTCASE ITSELF, AS WE ARE CONNECTED TO THE MESH SERVICES. 632 * START THE TESTCASE ITSELF, AS WE ARE CONNECTED TO THE MESH SERVICES.
666 * 633 *
667 * Testcase continues when the root receives confirmation of connected peers, 634 * Testcase continues when the root receives confirmation of connected peers,