aboutsummaryrefslogtreecommitdiff
path: root/forward.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 /forward.c
parentEliminated the limitation on the number of options that can be pushed (diff)
downloadopenvpn-e1e977f3cc52e230031f8770b0a9c977eab7db69.tar.xz
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 '')
-rw-r--r--forward.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/forward.c b/forward.c
index 2205054..87f3350 100644
--- a/forward.c
+++ b/forward.c
@@ -314,6 +314,19 @@ check_inactivity_timeout_dowork (struct context *c)
#if P2MP
+void
+check_server_poll_timeout_dowork (struct context *c)
+{
+ event_timeout_reset (&c->c2.server_poll_interval);
+ if (!tls_initial_packet_received (c->c2.tls_multi))
+ {
+ msg (M_INFO, "Server poll timeout, restarting");
+ c->sig->signal_received = SIGUSR1;
+ c->sig->signal_text = "server_poll";
+ c->persist.restart_sleep_seconds = -1;
+ }
+}
+
/*
* Schedule a SIGTERM n_seconds from now.
*/
@@ -516,6 +529,10 @@ process_coarse_timers (struct context *c)
return;
#if P2MP
+ check_server_poll_timeout (c);
+ if (c->sig->signal_received)
+ return;
+
check_scheduled_exit (c);
if (c->sig->signal_received)
return;