From: Bart Polot Date: Fri, 4 Nov 2011 20:34:14 +0000 (+0000) Subject: Reduced duplication X-Git-Tag: initial-import-from-subversion-38251~16038 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9457d1e70d656538747775475ba6cd5a8a84adf6;p=oweals%2Fgnunet.git Reduced duplication --- diff --git a/src/testing/testing.c b/src/testing/testing.c index 6edc1fc8c..b778b7d03 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -1830,18 +1830,6 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; } - if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) - { - if (ctx->d1th != NULL) - GNUNET_TRANSPORT_disconnect (ctx->d1th); - ctx->d1th = NULL; - if (ctx->d1core != NULL) - GNUNET_CORE_disconnect (ctx->d1core); - ctx->d1core = NULL; - GNUNET_free (ctx); - return; - } - if (ctx->d1th != NULL) GNUNET_TRANSPORT_disconnect (ctx->d1th); ctx->d1th = NULL; @@ -1849,6 +1837,12 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_CORE_disconnect (ctx->d1core); ctx->d1core = NULL; + if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) + { + GNUNET_free (ctx); + return; + } + if (ctx->connected == GNUNET_YES) { if (ctx->cb != NULL)