X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ftransport%2Ftest_transport_api_reliability.c;h=18971a986218950e7dc1984edec24c767c73134f;hb=aa390e34b0b9e793e1c9f82a606ad0c10fcc84ca;hp=f0c9d9db8f02683bfa45bc4f6cc45b937df559fd;hpb=d7181f0e7bc21fe4d7193cea580d034cd188ea48;p=oweals%2Fgnunet.git diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index f0c9d9db8..18971a986 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c @@ -38,16 +38,22 @@ #include "transport.h" #include "transport-testing.h" -#define VERBOSE GNUNET_YES +#define VERBOSE GNUNET_NO #define VERBOSE_ARM GNUNET_NO #define START_ARM GNUNET_YES +/** + * Testcase timeout + */ +#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) + /** * How long until we give up on transmitting the message? */ -#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500) +#define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) + static char *test_source; @@ -251,13 +257,18 @@ notify_ready (void *cls, size_t size, void *buf) unsigned int s; unsigned int ret; + th = NULL; if (buf == NULL) { - GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Timeout occurred while waiting for transmit_ready\n"); + if (GNUNET_SCHEDULER_NO_TASK != die_task) + GNUNET_SCHEDULER_cancel (die_task); + die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); ok = 42; return 0; } - th = NULL; + ret = 0; s = get_size (n); GNUNET_assert (size >= s); @@ -290,8 +301,8 @@ notify_ready (void *cls, size_t size, void *buf) { if (th == NULL) th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, s, 0, - TIMEOUT, ¬ify_ready, - NULL); + TIMEOUT_TRANSMIT, + ¬ify_ready, NULL); msg_scheduled = n; } if (n % 5000 == 0) @@ -348,7 +359,8 @@ sendtask () { start_time = GNUNET_TIME_absolute_get (); th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, get_size (0), 0, - TIMEOUT, ¬ify_ready, NULL); + TIMEOUT_TRANSMIT, ¬ify_ready, + NULL); } static void