aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-24 10:38:19 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-24 10:38:19 +0000
commit1023b88469981495e86eab478d4a8b3494eec258 (patch)
treec54293affa612eed22013b8f27cb8c400b7c04c0 /src/vpn
parenta4507745fddb1b7c5fc2ddfcdd453917cdbe595b (diff)
downloadgnunet-1023b88469981495e86eab478d4a8b3494eec258.tar.gz
gnunet-1023b88469981495e86eab478d4a8b3494eec258.zip
-fixes
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/test_gnunet_vpn.c25
-rw-r--r--src/vpn/test_gnunet_vpn.conf9
2 files changed, 28 insertions, 6 deletions
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,
124static void 124static void
125do_shutdown () 125do_shutdown ()
126{ 126{
127 GNUNET_SCHEDULER_cancel (mhd_task_id); 127 if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK)
128 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 128 {
129 MHD_stop_daemon (mhd); 129 GNUNET_SCHEDULER_cancel (mhd_task_id);
130 mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
131 }
132 if (NULL != mhd)
133 {
134 MHD_stop_daemon (mhd);
135 mhd = NULL;
136 }
130 if (NULL != rr) 137 if (NULL != rr)
131 { 138 {
132 GNUNET_VPN_cancel_request (rr); 139 GNUNET_VPN_cancel_request (rr);
133 rr = NULL; 140 rr = NULL;
134 } 141 }
135 GNUNET_VPN_disconnect (vpn); 142 if (NULL != vpn)
136 vpn = NULL; 143 {
144 GNUNET_VPN_disconnect (vpn);
145 vpn = NULL;
146 }
137 GNUNET_free_non_null (url); 147 GNUNET_free_non_null (url);
138 url = NULL; 148 url = NULL;
139} 149}
@@ -297,6 +307,7 @@ mhd_main ()
297 struct GNUNET_NETWORK_FDSet nws; 307 struct GNUNET_NETWORK_FDSet nws;
298 fd_set rs; 308 fd_set rs;
299 fd_set ws; 309 fd_set ws;
310 fd_set es;
300 int max_fd; 311 int max_fd;
301 unsigned MHD_LONG_LONG timeout; 312 unsigned MHD_LONG_LONG timeout;
302 struct GNUNET_TIME_Relative delay; 313 struct GNUNET_TIME_Relative delay;
@@ -304,9 +315,10 @@ mhd_main ()
304 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id); 315 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id);
305 FD_ZERO (&rs); 316 FD_ZERO (&rs);
306 FD_ZERO (&ws); 317 FD_ZERO (&ws);
318 FD_ZERO (&es);
307 max_fd = -1; 319 max_fd = -1;
308 GNUNET_assert (MHD_YES == 320 GNUNET_assert (MHD_YES ==
309 MHD_get_fdset (mhd, &rs, &ws, NULL, &max_fd)); 321 MHD_get_fdset (mhd, &rs, &ws, &es, &max_fd));
310 if (MHD_YES == MHD_get_timeout (mhd, &timeout)) 322 if (MHD_YES == MHD_get_timeout (mhd, &timeout))
311 delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 323 delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
312 (unsigned int) timeout); 324 (unsigned int) timeout);
@@ -348,6 +360,7 @@ run (void *cls, char *const *args, const char *cfgfile,
348 &mhd_ahc, NULL, 360 &mhd_ahc, NULL,
349 MHD_OPTION_SOCK_ADDR, &v4, 361 MHD_OPTION_SOCK_ADDR, &v4,
350 MHD_OPTION_END); 362 MHD_OPTION_END);
363 GNUNET_assert (NULL != mhd);
351 mhd_main (); 364 mhd_main ();
352 rr = GNUNET_VPN_redirect_to_ip (vpn, 365 rr = GNUNET_VPN_redirect_to_ip (vpn,
353 AF_INET, 366 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 @@
1[PATHS]
2SERVICEHOME = /tmp/gnunet-test-vpn/
3DEFAULTCONFIG = test_gnunet_vpn.conf
4
5
1[arm] 6[arm]
2DEFAULTSERVICES = statistics exit 7DEFAULTSERVICES = statistics exit
3PORT = 0 8PORT = 0
@@ -11,3 +16,7 @@ EXIT_IPV6 = YES
11# interface does not exist; can we use 'lo'? 16# interface does not exist; can we use 'lo'?
12EXIT_IFNAME = eth1 17EXIT_IFNAME = eth1
13 18
19
20[testing]
21WEAKRANDOM = YES
22HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat