diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 12:22:45 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 12:22:45 +0000 |
commit | 8a03ca53dd08d834b4d235dcae865e5c699d50ab (patch) | |
tree | 97ef650a06552493a673751ecdd6257857c57828 | |
parent | 18a7236ceb7e05e04c4a8736511821392516b78b (diff) | |
download | gnunet-8a03ca53dd08d834b4d235dcae865e5c699d50ab.tar.gz gnunet-8a03ca53dd08d834b4d235dcae865e5c699d50ab.zip |
shutdown callback
-rw-r--r-- | src/fs/fs_test_lib.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c index 0b1ff8955..19651079d 100644 --- a/src/fs/fs_test_lib.c +++ b/src/fs/fs_test_lib.c | |||
@@ -137,6 +137,27 @@ struct GNUNET_FS_TestDaemon | |||
137 | 137 | ||
138 | }; | 138 | }; |
139 | 139 | ||
140 | /** | ||
141 | * Check whether peers successfully shut down. | ||
142 | */ | ||
143 | void shutdown_callback (void *cls, | ||
144 | const char *emsg) | ||
145 | { | ||
146 | if (emsg != NULL) | ||
147 | { | ||
148 | #if VERBOSE | ||
149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
150 | "Shutdown of peers failed!\n"); | ||
151 | #endif | ||
152 | } | ||
153 | else | ||
154 | { | ||
155 | #if VERBOSE | ||
156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
157 | "All peers successfully shut down!\n"); | ||
158 | #endif | ||
159 | } | ||
160 | } | ||
140 | 161 | ||
141 | static void | 162 | static void |
142 | report_uri (void *cls, | 163 | report_uri (void *cls, |
@@ -307,7 +328,7 @@ start_timeout (void *cls, | |||
307 | struct StartContext *sctx = cls; | 328 | struct StartContext *sctx = cls; |
308 | unsigned int i; | 329 | unsigned int i; |
309 | 330 | ||
310 | GNUNET_TESTING_daemons_stop (sctx->group, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)); | 331 | GNUNET_TESTING_daemons_stop (sctx->group, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30), &shutdown_callback, NULL); |
311 | for (i=0;i<sctx->total;i++) | 332 | for (i=0;i<sctx->total;i++) |
312 | { | 333 | { |
313 | if (i < sctx->have) | 334 | if (i < sctx->have) |
@@ -507,7 +528,7 @@ GNUNET_FS_TEST_daemons_stop (struct GNUNET_SCHEDULER_Handle *sched, | |||
507 | GNUNET_free (daemons[i]); | 528 | GNUNET_free (daemons[i]); |
508 | daemons[i] = NULL; | 529 | daemons[i] = NULL; |
509 | } | 530 | } |
510 | GNUNET_TESTING_daemons_stop (pg, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)); | 531 | GNUNET_TESTING_daemons_stop (pg, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30), &shutdown_callback, NULL); |
511 | } | 532 | } |
512 | 533 | ||
513 | 534 | ||