From f24861f1b06362d683841e07bde180f34f738a10 Mon Sep 17 00:00:00 2001 From: Christian Fuchs Date: Tue, 24 Jun 2014 10:18:59 +0000 Subject: - added more debug messages to status2string - added remaining functionality to GNUNET_NAT_test_stop --- src/nat/nat_test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/nat/nat_test.c') diff --git a/src/nat/nat_test.c b/src/nat/nat_test.c index 860c51b26..90f06be5c 100644 --- a/src/nat/nat_test.c +++ b/src/nat/nat_test.c @@ -406,7 +406,7 @@ do_timeout (void *cls, * @param timeout delay after which the test should be aborted * @param report function to call with the result of the test * @param report_cls closure for @a report - * @return handle to cancel NAT test or NULL. The error is indicated through the report callback + * @return handle to cancel NAT test or NULL. The error is always indicated via the report callback */ struct GNUNET_NAT_Test * GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, @@ -489,10 +489,14 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, { LOG (GNUNET_ERROR_TYPE_ERROR, _("NAT test failed to start NAT library\n")); - if (GNUNET_SCHEDULER_NO_TASK != nh->ltask) + if (GNUNET_SCHEDULER_NO_TASK != nh->ltask){ GNUNET_SCHEDULER_cancel (nh->ltask); - if (NULL != nh->lsock) + nh->ltask = GNUNET_SCHEDULER_NO_TASK; + } + if (NULL != nh->lsock){ GNUNET_NETWORK_socket_close (nh->lsock); + nh->lsock = NULL; + } nh->status = GNUNET_NAT_ERROR_NAT_REGISTER_FAILED; nh->ttask = GNUNET_SCHEDULER_add_now (&do_timeout, nh); return NULL; -- cgit v1.2.3