From: Christian Grothoff Date: Tue, 24 Jan 2012 10:38:19 +0000 (+0000) Subject: -fixes X-Git-Tag: initial-import-from-subversion-38251~15156 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1023b88469981495e86eab478d4a8b3494eec258;p=oweals%2Fgnunet.git -fixes --- diff --git a/src/vpn/test_gnunet_vpn.c b/src/vpn/test_gnunet_vpn.c index 8cdd888b9..d363001f0 100644 --- a/src/vpn/test_gnunet_vpn.c +++ b/src/vpn/test_gnunet_vpn.c @@ -124,16 +124,26 @@ mhd_ahc (void *cls, static void do_shutdown () { - GNUNET_SCHEDULER_cancel (mhd_task_id); - mhd_task_id = GNUNET_SCHEDULER_NO_TASK; - MHD_stop_daemon (mhd); + if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK) + { + GNUNET_SCHEDULER_cancel (mhd_task_id); + mhd_task_id = GNUNET_SCHEDULER_NO_TASK; + } + if (NULL != mhd) + { + MHD_stop_daemon (mhd); + mhd = NULL; + } if (NULL != rr) { GNUNET_VPN_cancel_request (rr); rr = NULL; } - GNUNET_VPN_disconnect (vpn); - vpn = NULL; + if (NULL != vpn) + { + GNUNET_VPN_disconnect (vpn); + vpn = NULL; + } GNUNET_free_non_null (url); url = NULL; } @@ -297,6 +307,7 @@ mhd_main () struct GNUNET_NETWORK_FDSet nws; fd_set rs; fd_set ws; + fd_set es; int max_fd; unsigned MHD_LONG_LONG timeout; struct GNUNET_TIME_Relative delay; @@ -304,9 +315,10 @@ mhd_main () GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id); FD_ZERO (&rs); FD_ZERO (&ws); + FD_ZERO (&es); max_fd = -1; GNUNET_assert (MHD_YES == - MHD_get_fdset (mhd, &rs, &ws, NULL, &max_fd)); + MHD_get_fdset (mhd, &rs, &ws, &es, &max_fd)); if (MHD_YES == MHD_get_timeout (mhd, &timeout)) delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, (unsigned int) timeout); @@ -348,6 +360,7 @@ run (void *cls, char *const *args, const char *cfgfile, &mhd_ahc, NULL, MHD_OPTION_SOCK_ADDR, &v4, MHD_OPTION_END); + GNUNET_assert (NULL != mhd); mhd_main (); rr = GNUNET_VPN_redirect_to_ip (vpn, AF_INET, diff --git a/src/vpn/test_gnunet_vpn.conf b/src/vpn/test_gnunet_vpn.conf index e4eaffa9b..28052f275 100644 --- a/src/vpn/test_gnunet_vpn.conf +++ b/src/vpn/test_gnunet_vpn.conf @@ -1,3 +1,8 @@ +[PATHS] +SERVICEHOME = /tmp/gnunet-test-vpn/ +DEFAULTCONFIG = test_gnunet_vpn.conf + + [arm] DEFAULTSERVICES = statistics exit PORT = 0 @@ -11,3 +16,7 @@ EXIT_IPV6 = YES # interface does not exist; can we use 'lo'? EXIT_IFNAME = eth1 + +[testing] +WEAKRANDOM = YES +HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat