]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Modified client to send a PUSH_REQUEST message to server 1 second
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 16 Sep 2009 18:58:49 +0000 (18:58 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 16 Sep 2009 18:58:49 +0000 (18:58 +0000)
after connection initiation rather than 0 seconds after.
Successive PUSH_REQUEST messages after the first will continue to be
sent at 5 second intervals until a response is received.  This tends
to speed up the client connection sequence by 4 seconds because the
first PUSH_REQUEST message is usually sent too soon and is dropped,
causing a wait of 5 seconds until the next PUSH_REQUEST message is
sent.

Version 2.1_rc19d

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@4965 e7ae566f-a301-0410-adde-c780ea21d3b5

forward.c
interval.h
version.m4

index 2c26927e1f758dec525736cf98a598786fd0cba8..220505465c2315708ba1938067a0b82502e5c9ee 100644 (file)
--- a/forward.c
+++ b/forward.c
@@ -176,6 +176,9 @@ void
 check_push_request_dowork (struct context *c)
 {
   send_push_request (c);
+
+  /* if no response to first push_request, retry at 5 second intervals */
+  event_timeout_modify_wakeup (&c->c2.push_request_interval, 5);
 }
 
 #endif
@@ -204,10 +207,8 @@ check_connection_established_dowork (struct context *c)
                                        0);
                }
 #endif
-             send_push_request (c);
-
-             /* if no reply, try again in 5 sec */
-             event_timeout_init (&c->c2.push_request_interval, 5, now);
+             /* send push request in 1 sec */
+             event_timeout_init (&c->c2.push_request_interval, 1, now);
              reset_coarse_timers (c);
            }
          else
index afba9480f161a167aa8d0a3c5c0d73da9e934b25..f0e5875fb0e370d810f8a196686aae4eec7c2fc3 100644 (file)
@@ -177,6 +177,14 @@ event_timeout_reset (struct event_timeout* et)
     et->last = now;
 }
 
+static inline void
+event_timeout_modify_wakeup (struct event_timeout* et, interval_t n)
+{
+  /* note that you might need to call reset_coarse_timers after this */
+  if (et->defined)
+    et->n = (n >= 0) ? n : 0;
+}
+
 /*
  * This is the principal function for testing and triggering recurring
  * timers and will return true on a timer signal event.
index e3bb49297553634bf7ef0b49e067d5cf3306ca5e..887de1efe7a7b33bf59f95d2d502cac4d4df235e 100644 (file)
@@ -1,5 +1,5 @@
 dnl define the OpenVPN version
-define(PRODUCT_VERSION,[2.1_rc19c])
+define(PRODUCT_VERSION,[2.1_rc19d])
 dnl define the TAP version
 define(PRODUCT_TAP_ID,[tap0901])
 define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9])