summaryrefslogtreecommitdiff
path: root/src/openvpn/interval.c
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-12-27 18:25:47 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-12-27 18:25:47 +0100
commit79f3537f69e125f19f59c36aa090120a63186a54 (patch)
tree2089a3b7dac990841dbc2e4d9b2f535b82dbb0af /src/openvpn/interval.c
parentf2137fedb30cb87448eb03b2f288920df6187571 (diff)
parent3a2bbdb05ca6a6996e424c9fb225cb0d53804125 (diff)
Merge tag 'upstream/2.4.0'
Upstream version 2.4.0
Diffstat (limited to 'src/openvpn/interval.c')
-rw-r--r--src/openvpn/interval.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/openvpn/interval.c b/src/openvpn/interval.c
index 64494f1..99e72a0 100644
--- a/src/openvpn/interval.c
+++ b/src/openvpn/interval.c
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -35,49 +35,49 @@
#include "memdbg.h"
void
-interval_init (struct interval *top, int horizon, int refresh)
+interval_init(struct interval *top, int horizon, int refresh)
{
- CLEAR (*top);
- top->refresh = refresh;
- top->horizon = horizon;
+ CLEAR(*top);
+ top->refresh = refresh;
+ top->horizon = horizon;
}
bool
-event_timeout_trigger (struct event_timeout *et,
- struct timeval *tv,
- const int et_const_retry)
+event_timeout_trigger(struct event_timeout *et,
+ struct timeval *tv,
+ const int et_const_retry)
{
- bool ret = false;
- const time_t local_now = now;
+ bool ret = false;
+ const time_t local_now = now;
- if (et->defined)
+ if (et->defined)
{
- int wakeup = (int) et->last + et->n - local_now;
- if (wakeup <= 0)
- {
+ int wakeup = (int) et->last + et->n - local_now;
+ if (wakeup <= 0)
+ {
#if INTERVAL_DEBUG
- dmsg (D_INTERVAL, "EVENT event_timeout_trigger (%d) etcr=%d", et->n, et_const_retry);
+ dmsg(D_INTERVAL, "EVENT event_timeout_trigger (%d) etcr=%d", et->n, et_const_retry);
#endif
- if (et_const_retry < 0)
- {
- et->last = local_now;
- wakeup = et->n;
- ret = true;
- }
- else
- {
- wakeup = et_const_retry;
- }
- }
+ if (et_const_retry < 0)
+ {
+ et->last = local_now;
+ wakeup = et->n;
+ ret = true;
+ }
+ else
+ {
+ wakeup = et_const_retry;
+ }
+ }
- if (tv && wakeup < tv->tv_sec)
- {
+ if (tv && wakeup < tv->tv_sec)
+ {
#if INTERVAL_DEBUG
- dmsg (D_INTERVAL, "EVENT event_timeout_wakeup (%d/%d) etcr=%d", wakeup, et->n, et_const_retry);
+ dmsg(D_INTERVAL, "EVENT event_timeout_wakeup (%d/%d) etcr=%d", wakeup, et->n, et_const_retry);
#endif
- tv->tv_sec = wakeup;
- tv->tv_usec = 0;
- }
+ tv->tv_sec = wakeup;
+ tv->tv_usec = 0;
+ }
}
- return ret;
+ return ret;
}