From e1e977f3cc52e230031f8770b0a9c977eab7db69 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 28 Sep 2009 07:27:22 +0000 Subject: Added --server-poll-timeout option : when polling possible remote servers to connect to in a round-robin fashion, spend no more than n seconds waiting for a response before trying the next server. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5010 e7ae566f-a301-0410-adde-c780ea21d3b5 --- init.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'init.c') diff --git a/init.c b/init.c index 9d29af7..20ca0a5 100644 --- a/init.c +++ b/init.c @@ -792,6 +792,11 @@ do_init_timers (struct context *c, bool deferred) if (c->options.ping_rec_timeout) event_timeout_init (&c->c2.ping_rec_interval, c->options.ping_rec_timeout, now); +#if P2MP + if (c->options.server_poll_timeout) + event_timeout_init (&c->c2.server_poll_interval, c->options.server_poll_timeout, now); +#endif + if (!deferred) { /* initialize connection establishment timer */ @@ -1444,10 +1449,15 @@ socket_restart_pause (struct context *c) #if P2MP if (auth_retry_get () == AR_NOINTERACT) sec = 10; + + if (c->options.server_poll_timeout && sec > 1) + sec = 1; #endif if (c->persist.restart_sleep_seconds > 0 && c->persist.restart_sleep_seconds > sec) sec = c->persist.restart_sleep_seconds; + else if (c->persist.restart_sleep_seconds == -1) + sec = 0; c->persist.restart_sleep_seconds = 0; /* do managment hold on context restart, i.e. second, third, fourth, etc. initialization */ -- cgit v1.2.3