summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-28 13:39:31 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-28 13:39:31 +0000
commitff3cd09b02c06f9ac844bc1d0fd1bf525c565308 (patch)
treea76dd98ca84d918a0e6989cb1cf05eba32742b12
parent8677cba802a0616f73fd16efe7ecd89752fb442e (diff)
-delay HTTP request 1s to ensure VPN is really up
-rw-r--r--src/pt/test_gns_vpn.c2
-rw-r--r--src/pt/test_gns_vpn.conf3
-rw-r--r--src/pt/test_gnunet_vpn.c22
3 files changed, 11 insertions, 16 deletions
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index e030842b5..40c32d27a 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -322,7 +322,7 @@ commence_testing (void *cls,
}
/* wait a little bit before downloading, as we just created the record */
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
- (GNUNET_TIME_UNIT_SECONDS, 5),
+ (GNUNET_TIME_UNIT_SECONDS, 1),
&start_curl,
NULL);
}
diff --git a/src/pt/test_gns_vpn.conf b/src/pt/test_gns_vpn.conf
index 2a683ca7f..ac9724c04 100644
--- a/src/pt/test_gns_vpn.conf
+++ b/src/pt/test_gns_vpn.conf
@@ -35,6 +35,9 @@ FORCESTART = YES
AUTOSTART = NO
FORCESTART = NO
+#[vpn]
+#PREFIX = valgrind
+
[nse]
WORKBITS = 1
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index 3f252cb46..eb90abf8f 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);
}