diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-11-04 20:34:14 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-11-04 20:34:14 +0000 |
commit | 9457d1e70d656538747775475ba6cd5a8a84adf6 (patch) | |
tree | 6485bcbcc4d638e585a6dc23d7cc9773a9998d00 /src/testing | |
parent | db37bac931cb7b6d7c687c4c9bcec48e35e6080c (diff) | |
download | gnunet-9457d1e70d656538747775475ba6cd5a8a84adf6.tar.gz gnunet-9457d1e70d656538747775475ba6cd5a8a84adf6.zip |
Reduced duplication
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing.c | 18 |
1 files 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) | |||
1830 | ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; | 1830 | ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; |
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | ||
1834 | { | ||
1835 | if (ctx->d1th != NULL) | ||
1836 | GNUNET_TRANSPORT_disconnect (ctx->d1th); | ||
1837 | ctx->d1th = NULL; | ||
1838 | if (ctx->d1core != NULL) | ||
1839 | GNUNET_CORE_disconnect (ctx->d1core); | ||
1840 | ctx->d1core = NULL; | ||
1841 | GNUNET_free (ctx); | ||
1842 | return; | ||
1843 | } | ||
1844 | |||
1845 | if (ctx->d1th != NULL) | 1833 | if (ctx->d1th != NULL) |
1846 | GNUNET_TRANSPORT_disconnect (ctx->d1th); | 1834 | GNUNET_TRANSPORT_disconnect (ctx->d1th); |
1847 | ctx->d1th = NULL; | 1835 | ctx->d1th = NULL; |
@@ -1849,6 +1837,12 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1849 | GNUNET_CORE_disconnect (ctx->d1core); | 1837 | GNUNET_CORE_disconnect (ctx->d1core); |
1850 | ctx->d1core = NULL; | 1838 | ctx->d1core = NULL; |
1851 | 1839 | ||
1840 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | ||
1841 | { | ||
1842 | GNUNET_free (ctx); | ||
1843 | return; | ||
1844 | } | ||
1845 | |||
1852 | if (ctx->connected == GNUNET_YES) | 1846 | if (ctx->connected == GNUNET_YES) |
1853 | { | 1847 | { |
1854 | if (ctx->cb != NULL) | 1848 | if (ctx->cb != NULL) |