diff options
Diffstat (limited to 'src/openvpn/interval.c')
-rw-r--r-- | src/openvpn/interval.c | 66 |
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; } |