fix testing
authorChristian Grothoff <christian@grothoff.org>
Tue, 18 May 2010 08:17:22 +0000 (08:17 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 18 May 2010 08:17:22 +0000 (08:17 +0000)
TODO
src/testing/testing.c

diff --git a/TODO b/TODO
index 0e6f5846af20312e8490d8e4c2a335a178313a43..9cf5a16450d9854fb5dc2efe2e93318372f866eb 100644 (file)
--- 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 <program_main>, task_cls=0xbfb217e4)
-    at scheduler.c:642
-
-
 * TBENCH: [MW]
   - good to have for transport/DV evaluation! 
 * DV: [Nate]
index 6d75be6a5a635a5c9a6ee8184d8af22bb60a472d..82abbdd97bd94a28b76071fc129d6676317cf3eb 100644 (file)
@@ -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,
-                                &notify_connect_result,
-                                ctx);
+      ctx->timeout_task = GNUNET_SCHEDULER_add_now (ctx->d1->sched,
+                                                   &notify_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), 
                                                     &notify_connect_result, ctx);
 
   ctx->hello_send_task = GNUNET_SCHEDULER_add_now(ctx->d1->sched, &send_hello, ctx);