diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 12:23:43 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-28 12:23:43 +0000 |
commit | b894ca5530d3e0f15c0a28cac78c5f9e9e2c1019 (patch) | |
tree | c0968151a74c38ea687932170e6fcb70885820b4 | |
parent | 556b586c5d998902b3e9d8ca1dd7ae9be8d8f2ca (diff) | |
download | gnunet-b894ca5530d3e0f15c0a28cac78c5f9e9e2c1019.tar.gz gnunet-b894ca5530d3e0f15c0a28cac78c5f9e9e2c1019.zip |
shutdown context
-rw-r--r-- | src/dv/test_transport_api_dv.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index 1983908e8..31e0a370b 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c | |||
@@ -166,6 +166,30 @@ static struct TestMessageContext *test_messages; | |||
166 | 166 | ||
167 | static struct TestMessageContext *other_test_messages; | 167 | static struct TestMessageContext *other_test_messages; |
168 | 168 | ||
169 | /** | ||
170 | * Check whether peers successfully shut down. | ||
171 | */ | ||
172 | void shutdown_callback (void *cls, | ||
173 | const char *emsg) | ||
174 | { | ||
175 | if (emsg != NULL) | ||
176 | { | ||
177 | #if VERBOSE | ||
178 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
179 | "Shutdown of peers failed!\n"); | ||
180 | #endif | ||
181 | if (ok == 0) | ||
182 | ok = 666; | ||
183 | } | ||
184 | else | ||
185 | { | ||
186 | #if VERBOSE | ||
187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
188 | "All peers successfully shut down!\n"); | ||
189 | #endif | ||
190 | } | ||
191 | } | ||
192 | |||
169 | static void | 193 | static void |
170 | finish_testing () | 194 | finish_testing () |
171 | { | 195 | { |
@@ -244,7 +268,7 @@ finish_testing () | |||
244 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 268 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
245 | "Calling daemons_stop\n"); | 269 | "Calling daemons_stop\n"); |
246 | #endif | 270 | #endif |
247 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | 271 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
248 | #if VERBOSE | 272 | #if VERBOSE |
249 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
250 | "daemons_stop finished\n"); | 274 | "daemons_stop finished\n"); |
@@ -349,7 +373,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
349 | 373 | ||
350 | if (pg != NULL) | 374 | if (pg != NULL) |
351 | { | 375 | { |
352 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | 376 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
353 | ok = 7331; /* Opposite of leet */ | 377 | ok = 7331; /* Opposite of leet */ |
354 | } | 378 | } |
355 | else | 379 | else |