aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-03-02 12:38:59 +0000
committerNathan S. Evans <evans@in.tum.de>2011-03-02 12:38:59 +0000
commit159812ea46c31e6fe403d7da4fc2ba0c7193d8e7 (patch)
tree78a68cf3ebfa1ea85797b42bdae955899110cc0a /src/testing
parent647d9ce98c20e6c53c72b3e43f1a6cb67f6ae935 (diff)
downloadgnunet-159812ea46c31e6fe403d7da4fc2ba0c7193d8e7.tar.gz
gnunet-159812ea46c31e6fe403d7da4fc2ba0c7193d8e7.zip
My brain is melted.
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index ba91e4601..f876e05c1 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -382,7 +382,15 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
382 } 382 }
383 else /* Already have a hostkey! */ 383 else /* Already have a hostkey! */
384 { 384 {
385 d->phase = SP_HOSTKEY_CREATED; 385 if (d->hostkey_callback != NULL)
386 {
387 d->hostkey_callback (d->hostkey_cls, &d->id, d, NULL);
388 d->hostkey_callback = NULL;
389 d->phase = SP_HOSTKEY_CREATED;
390 }
391 else
392 d->phase = SP_TOPOLOGY_SETUP;
393
386 /* wait some more */ 394 /* wait some more */
387 d->task 395 d->task
388 = GNUNET_SCHEDULER_add_now (&start_fsm, d); 396 = GNUNET_SCHEDULER_add_now (&start_fsm, d);
@@ -443,12 +451,6 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
443 GNUNET_OS_process_close (d->proc); 451 GNUNET_OS_process_close (d->proc);
444 d->proc = NULL; 452 d->proc = NULL;
445 d->have_hostkey = GNUNET_YES; 453 d->have_hostkey = GNUNET_YES;
446#if DEBUG_TESTING
447 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully got hostkey!\n");
448#endif
449 /* Fall through */
450 case SP_HOSTKEY_CREATED:
451 GNUNET_assert(d->have_hostkey == GNUNET_YES);
452 if (d->hostkey_callback != NULL) 454 if (d->hostkey_callback != NULL)
453 { 455 {
454 d->hostkey_callback (d->hostkey_cls, &d->id, d, NULL); 456 d->hostkey_callback (d->hostkey_cls, &d->id, d, NULL);
@@ -459,6 +461,11 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
459 { 461 {
460 d->phase = SP_TOPOLOGY_SETUP; 462 d->phase = SP_TOPOLOGY_SETUP;
461 } 463 }
464#if DEBUG_TESTING
465 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully got hostkey!\n");
466#endif
467 /* Fall through */
468 case SP_HOSTKEY_CREATED:
462 /* wait for topology finished */ 469 /* wait for topology finished */
463 if ((GNUNET_YES == d->dead) 470 if ((GNUNET_YES == d->dead)
464 || (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 471 || (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value ==