diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-05-12 15:48:52 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-05-12 15:48:52 +0000 |
commit | dfe5fd29a357766ad681d7c95c47e06717367aa4 (patch) | |
tree | ef75959224a76f3e27aca614219267f4d14e96b0 /src/testing/testing.c | |
parent | 0bba5c2a473984a776f37ff064e926e4f0742f24 (diff) | |
download | gnunet-dfe5fd29a357766ad681d7c95c47e06717367aa4.tar.gz gnunet-dfe5fd29a357766ad681d7c95c47e06717367aa4.zip |
churn fixes and testcase
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r-- | src/testing/testing.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index 1bf3e40cd..6d75be6a5 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "gnunet_hello_lib.h" | 38 | #include "gnunet_hello_lib.h" |
39 | 39 | ||
40 | #define DEBUG_TESTING GNUNET_NO | 40 | #define DEBUG_TESTING GNUNET_NO |
41 | #define DEBUG_TESTING_RECONNECT GNUNET_YES | 41 | #define DEBUG_TESTING_RECONNECT GNUNET_NO |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * How long do we wait after starting gnunet-service-arm | 44 | * How long do we wait after starting gnunet-service-arm |
@@ -544,6 +544,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
544 | return; | 544 | return; |
545 | } | 545 | } |
546 | /* wait some more */ | 546 | /* wait some more */ |
547 | fprintf(stderr, "scheduling in shutdown_start\n"); | ||
547 | d->task | 548 | d->task |
548 | = GNUNET_SCHEDULER_add_delayed (d->sched, | 549 | = GNUNET_SCHEDULER_add_delayed (d->sched, |
549 | GNUNET_CONSTANTS_EXEC_WAIT, | 550 | GNUNET_CONSTANTS_EXEC_WAIT, |
@@ -589,11 +590,15 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
589 | } | 590 | } |
590 | 591 | ||
591 | GNUNET_free_non_null(d->hello); | 592 | GNUNET_free_non_null(d->hello); |
593 | d->hello = NULL; | ||
592 | GNUNET_free_non_null (d->shortname); | 594 | GNUNET_free_non_null (d->shortname); |
595 | d->shortname = NULL; | ||
593 | if (NULL != d->dead_cb) | 596 | if (NULL != d->dead_cb) |
594 | d->dead_cb (d->dead_cb_cls, NULL); | 597 | d->dead_cb (d->dead_cb_cls, NULL); |
595 | 598 | ||
596 | GNUNET_free (d); | 599 | if (d->churn == GNUNET_NO) |
600 | GNUNET_free (d); | ||
601 | |||
597 | break; | 602 | break; |
598 | case SP_CONFIG_UPDATE: | 603 | case SP_CONFIG_UPDATE: |
599 | /* confirm copying complete */ | 604 | /* confirm copying complete */ |
@@ -969,6 +974,7 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
969 | 974 | ||
970 | if (allow_restart == GNUNET_YES) | 975 | if (allow_restart == GNUNET_YES) |
971 | d->churn = GNUNET_YES; | 976 | d->churn = GNUNET_YES; |
977 | |||
972 | if (d->th != NULL) | 978 | if (d->th != NULL) |
973 | { | 979 | { |
974 | GNUNET_TRANSPORT_get_hello_cancel(d->th, &process_hello, d); | 980 | GNUNET_TRANSPORT_get_hello_cancel(d->th, &process_hello, d); |
@@ -1014,10 +1020,10 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
1014 | 1020 | ||
1015 | GNUNET_free_non_null(del_arg); | 1021 | GNUNET_free_non_null(del_arg); |
1016 | d->max_timeout = GNUNET_TIME_relative_to_absolute(timeout); | 1022 | d->max_timeout = GNUNET_TIME_relative_to_absolute(timeout); |
1023 | fprintf(stderr, "scheduling shutdown fsm phase\n"); | ||
1017 | d->task | 1024 | d->task |
1018 | = GNUNET_SCHEDULER_add_delayed (d->sched, | 1025 | = GNUNET_SCHEDULER_add_now (d->sched, |
1019 | GNUNET_CONSTANTS_EXEC_WAIT, | 1026 | &start_fsm, d); |
1020 | &start_fsm, d); | ||
1021 | } | 1027 | } |
1022 | 1028 | ||
1023 | 1029 | ||
@@ -1407,7 +1413,7 @@ reattempt_daemons_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext | |||
1407 | return; | 1413 | return; |
1408 | } | 1414 | } |
1409 | #if DEBUG_TESTING_RECONNECT | 1415 | #if DEBUG_TESTING_RECONNECT |
1410 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "re-attempting connect of peer %s to peer %s\n", | 1416 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "re-attempting connect of peer %s to peer %s\n", |
1411 | ctx->d1->shortname, ctx->d2->shortname); | 1417 | ctx->d1->shortname, ctx->d2->shortname); |
1412 | #endif | 1418 | #endif |
1413 | 1419 | ||