From 9457d1e70d656538747775475ba6cd5a8a84adf6 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 4 Nov 2011 20:34:14 +0000 Subject: [PATCH] Reduced duplication --- src/testing/testing.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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) -- 2.25.1