diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2006-06-11 04:22:11 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2006-06-11 04:22:11 +0000 |
commit | 838911cc424dcc0c03db1e9b256965976068c1a1 (patch) | |
tree | 91f58a1f1f5bb6ad18a44dfbdef711de5d63d7a4 /forward-inline.h | |
parent | A few more updates: (diff) | |
download | openvpn-838911cc424dcc0c03db1e9b256965976068c1a1.tar.xz |
Added optional minimum-number-of-bytes
parameter to --inactive directive.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1036 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'forward-inline.h')
-rw-r--r-- | forward-inline.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/forward-inline.h b/forward-inline.h index 0ba0b23..09b9809 100644 --- a/forward-inline.h +++ b/forward-inline.h @@ -224,10 +224,17 @@ get_link_socket_info (struct context *c) } static inline void -register_activity (struct context *c) +register_activity (struct context *c, const int size) { if (c->options.inactivity_timeout) - event_timeout_reset (&c->c2.inactivity_interval); + { + c->c2.inactivity_bytes += size; + if (c->c2.inactivity_bytes >= c->options.inactivity_minimum_bytes) + { + c->c2.inactivity_bytes = 0; + event_timeout_reset (&c->c2.inactivity_interval); + } + } } /* |