From: Christian Grothoff Date: Tue, 18 May 2010 08:17:22 +0000 (+0000) Subject: fix testing X-Git-Tag: initial-import-from-subversion-38251~21662 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d34c5bfd6feda8af67d2d27e77ca81341ea24f41;p=oweals%2Fgnunet.git fix testing --- diff --git a/TODO b/TODO index 0e6f5846a..9cf5a1645 100644 --- a/TODO +++ b/TODO @@ -50,26 +50,6 @@ May 16 12:49:50 fs-13737 WARNING Could not access indexed file `ENUTBMBR' at off ==14995== by 0x804F725: main (gnunet-service-fs.c:3506) ==14995== -* TESTING: -1206 if ((ctx->timeout_task != GNUNET_SCHEDULER_NO_TASK) && (tc->reason != GNUNET_SCHEDULER_R│ - │1207 { │ - >│1208 GNUNET_SCHEDULER_cancel(ctx->d1->sched, ctx->timeout_task); │ - │1209 ctx->timeout_task = GNUNET_SCHEDULER_NO_TASK; │ - │1210 } │ - -(gdb) print tc->reason -$5 = GNUNET_SCHEDULER_REASON_SHUTDOWN - - #0 0x00d4c422 in __kernel_vsyscall () -#1 0x00148651 in raise () from /lib/tls/i686/cmov/libc.so.6 -#2 0x0014ba82 in abort () from /lib/tls/i686/cmov/libc.so.6 -#3 0x005fe4a5 in GNUNET_SCHEDULER_cancel (sched=0xbfb216ac, task=70) at scheduler.c:734 -#4 0x00114fdd in notify_connect_result (cls=0x8b582c8, tc=0xbfb21648) at testing.c:1208 -#5 0x005fde79 in run_ready (sched=0xbfb216ac) at scheduler.c:514 -#6 0x005fe315 in GNUNET_SCHEDULER_run (task=0x5fa53c , task_cls=0xbfb217e4) - at scheduler.c:642 - - * TBENCH: [MW] - good to have for transport/DV evaluation! * DV: [Nate] diff --git a/src/testing/testing.c b/src/testing/testing.c index 6d75be6a5..82abbdd97 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -1197,18 +1197,12 @@ notify_connect_result (void *cls, struct ConnectContext *ctx = cls; struct GNUNET_TIME_Relative remaining; + ctx->timeout_task = GNUNET_SCHEDULER_NO_TASK; if (ctx->hello_send_task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel(ctx->d1->sched, ctx->hello_send_task); ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; } - - if ((ctx->timeout_task != GNUNET_SCHEDULER_NO_TASK) && (tc->reason != GNUNET_SCHEDULER_REASON_TIMEOUT)) - { - GNUNET_SCHEDULER_cancel(ctx->d1->sched, ctx->timeout_task); - ctx->timeout_task = GNUNET_SCHEDULER_NO_TASK; - } - if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) { if (ctx->d2th != NULL) @@ -1285,10 +1279,9 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity * peer, struct GNUNE { ctx->connected = GNUNET_YES; GNUNET_SCHEDULER_cancel(ctx->d1->sched, ctx->timeout_task); - ctx->timeout_task = GNUNET_SCHEDULER_NO_TASK; - GNUNET_SCHEDULER_add_now (ctx->d1->sched, - ¬ify_connect_result, - ctx); + ctx->timeout_task = GNUNET_SCHEDULER_add_now (ctx->d1->sched, + ¬ify_connect_result, + ctx); } } @@ -1298,9 +1291,9 @@ send_hello(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct ConnectContext *ctx = cls; + ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) return; - if (ctx->d1->hello != NULL) { GNUNET_TRANSPORT_offer_hello (ctx->d2th, GNUNET_HELLO_get_header(ctx->d1->hello)); @@ -1397,7 +1390,8 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, } ctx->timeout_task = GNUNET_SCHEDULER_add_delayed (d1->sched, - GNUNET_TIME_relative_divide(ctx->relative_timeout, max_connect_attempts), /* Allow up to 8 reconnect attempts */ + GNUNET_TIME_relative_divide(ctx->relative_timeout, + max_connect_attempts), ¬ify_connect_result, ctx); ctx->hello_send_task = GNUNET_SCHEDULER_add_now(ctx->d1->sched, &send_hello, ctx);