0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00

AsioTimer: use expires_after() method when possible.

A common AsioTimer usage pattern is:

  expires_at(Time::now() + duration)

This is more succinctly and efficiently stated as:

  expires_after(duration).

Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
James Yonan 2017-04-12 14:07:02 -06:00 committed by Lev Stipakov
parent d3da69e35c
commit 35c0480180
No known key found for this signature in database
GPG Key ID: 88670BE258B9C258

View File

@ -632,7 +632,7 @@ namespace openvpn {
void stop_omi_client(const bool eof, const unsigned int milliseconds)
{
stop_timer.expires_at(Time::now() + Time::Duration::milliseconds(milliseconds));
stop_timer.expires_after(Time::Duration::milliseconds(milliseconds));
stop_timer.async_wait([self=Ptr(this), eof](const openvpn_io::error_code& error)
{
if (!error)