summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-09-28 07:27:22 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2009-09-28 07:27:22 +0000
commite1e977f3cc52e230031f8770b0a9c977eab7db69 (patch)
treeb388e4c981ee17ebc53e4baf621b103cf839fc00 /options.c
parent3eee126eba7314e203a50b6398fa5333cbf12ff7 (diff)
downloadopenvpn-e1e977f3cc52e230031f8770b0a9c977eab7db69.tar.gz
openvpn-e1e977f3cc52e230031f8770b0a9c977eab7db69.tar.xz
openvpn-e1e977f3cc52e230031f8770b0a9c977eab7db69.zip
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
Diffstat (limited to 'options.c')
-rw-r--r--options.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/options.c b/options.c
index ce16b56..afd804f 100644
--- a/options.c
+++ b/options.c
@@ -432,6 +432,9 @@ static const char usage_message[] =
" when connecting to a '--mode server' remote host.\n"
"--auth-retry t : How to handle auth failures. Set t to\n"
" none (default), interact, or nointeract.\n"
+ "--server-poll-timeout n : when polling possible remote servers to connect to\n"
+ " in a round-robin fashion, spend no more than n seconds\n"
+ " waiting for a response before trying the next server.\n"
#endif
#ifdef ENABLE_OCC
"--explicit-exit-notify [n] : On exit/restart, send exit signal to\n"
@@ -726,6 +729,7 @@ init_options (struct options *o, const bool init_gc)
#endif
#if P2MP
o->scheduled_exit_interval = 5;
+ o->server_poll_timeout = 0;
#endif
#ifdef USE_CRYPTO
o->ciphername = "BF-CBC";
@@ -4464,6 +4468,12 @@ add_option (struct options *options,
{
options->sockflags |= SF_HOST_RANDOMIZE;
}
+#if P2MP
+ else if (streq (p[1], "SERVER_POLL_TIMEOUT") && p[2])
+ {
+ options->server_poll_timeout = positive_atoi(p[2]);
+ }
+#endif
else
{
if (streq (p[1], "FORWARD_COMPATIBLE") && p[2] && streq (p[2], "1"))
@@ -4887,6 +4897,11 @@ add_option (struct options *options,
VERIFY_PERMISSION (OPT_P_PULL_MODE);
options->push_continuation = atoi(p[1]);
}
+ else if (streq (p[0], "server-poll-timeout") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->server_poll_timeout = positive_atoi(p[1]);
+ }
else if (streq (p[0], "auth-user-pass"))
{
VERIFY_PERMISSION (OPT_P_GENERAL);