diff options
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/test_mesh_small_unicast.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mesh/test_mesh_small_unicast.c b/src/mesh/test_mesh_small_unicast.c index cc95a34e8..ad5a0fd22 100644 --- a/src/mesh/test_mesh_small_unicast.c +++ b/src/mesh/test_mesh_small_unicast.c | |||
@@ -57,7 +57,7 @@ struct StatsContext | |||
57 | */ | 57 | */ |
58 | #define SHORT_TIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) | 58 | #define SHORT_TIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) |
59 | 59 | ||
60 | #define OK_GOAL 4 | 60 | #define OK_GOAL 5 |
61 | 61 | ||
62 | static int ok; | 62 | static int ok; |
63 | 63 | ||
@@ -241,9 +241,11 @@ data_callback (void *cls, | |||
241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
242 | "test: Origin client got a response!\n"); | 242 | "test: Origin client got a response!\n"); |
243 | ok++; | 243 | ok++; |
244 | GNUNET_MESH_tunnel_destroy (tunnel); | ||
244 | GNUNET_SCHEDULER_cancel (disconnect_task); | 245 | GNUNET_SCHEDULER_cancel (disconnect_task); |
245 | disconnect_task = GNUNET_SCHEDULER_add_now(&disconnect_mesh_peers, | 246 | disconnect_task = GNUNET_SCHEDULER_add_delayed(SHORT_TIME, |
246 | NULL); | 247 | &disconnect_mesh_peers, |
248 | NULL); | ||
247 | break; | 249 | break; |
248 | case 2L: | 250 | case 2L: |
249 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 251 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -320,9 +322,16 @@ static void | |||
320 | tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, | 322 | tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, |
321 | void *tunnel_ctx) | 323 | void *tunnel_ctx) |
322 | { | 324 | { |
323 | #if VERBOSE | 325 | long i = (long) cls; |
324 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: tunnel disconnected\n"); | 326 | |
325 | #endif | 327 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
328 | "test: Incoming tunnel disconnected at peer %d\n", | ||
329 | i); | ||
330 | if (2L == i) | ||
331 | ok++; | ||
332 | |||
333 | GNUNET_SCHEDULER_cancel (disconnect_task); | ||
334 | disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers, NULL); | ||
326 | 335 | ||
327 | return; | 336 | return; |
328 | } | 337 | } |
@@ -345,7 +354,7 @@ dh (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
345 | 354 | ||
346 | 355 | ||
347 | /** | 356 | /** |
348 | * Method called whenever a tunnel is established. | 357 | * Method called whenever a peer connects to a tunnel. |
349 | * | 358 | * |
350 | * @param cls closure | 359 | * @param cls closure |
351 | * @param peer peer identity the tunnel was created to, NULL on timeout | 360 | * @param peer peer identity the tunnel was created to, NULL on timeout |