[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17632 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17632 - gnunet/src/mesh |
Date: |
Thu, 20 Oct 2011 14:50:49 +0200 |
Author: bartpolot
Date: 2011-10-20 14:50:49 +0200 (Thu, 20 Oct 2011)
New Revision: 17632
Modified:
gnunet/src/mesh/test_mesh_small_unicast.c
Log:
Added tunnel destruction to the testcase
Modified: gnunet/src/mesh/test_mesh_small_unicast.c
===================================================================
--- gnunet/src/mesh/test_mesh_small_unicast.c 2011-10-20 12:49:52 UTC (rev
17631)
+++ gnunet/src/mesh/test_mesh_small_unicast.c 2011-10-20 12:50:49 UTC (rev
17632)
@@ -57,7 +57,7 @@
*/
#define SHORT_TIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-#define OK_GOAL 4
+#define OK_GOAL 5
static int ok;
@@ -241,9 +241,11 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: Origin client got a response!\n");
ok++;
+ GNUNET_MESH_tunnel_destroy (tunnel);
GNUNET_SCHEDULER_cancel (disconnect_task);
- disconnect_task = GNUNET_SCHEDULER_add_now(&disconnect_mesh_peers,
- NULL);
+ disconnect_task = GNUNET_SCHEDULER_add_delayed(SHORT_TIME,
+ &disconnect_mesh_peers,
+ NULL);
break;
case 2L:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -320,10 +322,17 @@
tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel,
void *tunnel_ctx)
{
-#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: tunnel disconnected\n");
-#endif
+ long i = (long) cls;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "test: Incoming tunnel disconnected at peer %d\n",
+ i);
+ if (2L == i)
+ ok++;
+ GNUNET_SCHEDULER_cancel (disconnect_task);
+ disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers, NULL);
+
return;
}
@@ -345,7 +354,7 @@
/**
- * Method called whenever a tunnel is established.
+ * Method called whenever a peer connects to a tunnel.
*
* @param cls closure
* @param peer peer identity the tunnel was created to, NULL on timeout
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17632 - gnunet/src/mesh,
gnunet <=