From: Nathan S. Evans Date: Mon, 28 Jun 2010 12:23:43 +0000 (+0000) Subject: shutdown context X-Git-Tag: initial-import-from-subversion-38251~21161 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b894ca5530d3e0f15c0a28cac78c5f9e9e2c1019;p=oweals%2Fgnunet.git shutdown context --- 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; static struct TestMessageContext *other_test_messages; +/** + * Check whether peers successfully shut down. + */ +void shutdown_callback (void *cls, + const char *emsg) +{ + if (emsg != NULL) + { +#if VERBOSE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Shutdown of peers failed!\n"); +#endif + if (ok == 0) + ok = 666; + } + else + { +#if VERBOSE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "All peers successfully shut down!\n"); +#endif + } +} + static void finish_testing () { @@ -244,7 +268,7 @@ finish_testing () GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); #endif - GNUNET_TESTING_daemons_stop (pg, TIMEOUT); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); @@ -349,7 +373,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) if (pg != NULL) { - GNUNET_TESTING_daemons_stop (pg, TIMEOUT); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); ok = 7331; /* Opposite of leet */ } else