diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-28 13:39:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-28 13:39:31 +0000 |
commit | ff3cd09b02c06f9ac844bc1d0fd1bf525c565308 (patch) | |
tree | a76dd98ca84d918a0e6989cb1cf05eba32742b12 /src/pt/test_gnunet_vpn.c | |
parent | 8677cba802a0616f73fd16efe7ecd89752fb442e (diff) |
-delay HTTP request 1s to ensure VPN is really up
Diffstat (limited to 'src/pt/test_gnunet_vpn.c')
-rw-r--r-- | src/pt/test_gnunet_vpn.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c index 3f252cb469..eb90abf8f9 100644 --- a/src/pt/test_gnunet_vpn.c +++ b/src/pt/test_gnunet_vpn.c @@ -167,19 +167,8 @@ do_shutdown () * Function to run the HTTP client. */ static void -curl_main (void); - - -static void -curl_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) -{ - curl_task_id = NULL; - curl_main (); -} - - -static void -curl_main () +curl_main (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) { fd_set rs; fd_set ws; @@ -192,6 +181,7 @@ curl_main () int running; struct CURLMsg *msg; + curl_task_id = NULL; max = 0; FD_ZERO (&rs); FD_ZERO (&ws); @@ -241,7 +231,7 @@ curl_main () GNUNET_NETWORK_fdset_copy_native (&nws, &ws, max + 1); curl_task_id = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, delay, - &nrs, &nws, &curl_task, NULL); + &nrs, &nws, &curl_main, NULL); } @@ -296,7 +286,9 @@ allocation_cb (void *cls, int af, const void *address) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Beginning HTTP download from `%s'\n", url); - curl_main (); + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, + &curl_main, + NULL); } |