mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
Replace AsioTimer with AsioTimerSafe in cases where handler doesn't clearly check for late cancellation
As noted in the Asio documentation, an AsioTimer handler can be called with a non-error status after timer cancellation. Unfortunately, this can lead to race conditions, so I'm moving over all AsioTimer users to AsioTimerSafe when I don't see the handler clearly checking for late cancellation. Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
ac158fd0bf
commit
80e754d00a
@ -27,7 +27,7 @@
|
||||
#include <openvpn/common/options.hpp>
|
||||
#include <openvpn/buffer/bufstr.hpp>
|
||||
#include <openvpn/time/timestr.hpp>
|
||||
#include <openvpn/time/asiotimer.hpp>
|
||||
#include <openvpn/time/asiotimersafe.hpp>
|
||||
#include <openvpn/asio/asiowork.hpp>
|
||||
|
||||
// include acceptors for different protocols
|
||||
@ -977,7 +977,7 @@ namespace openvpn {
|
||||
|
||||
// stopping
|
||||
volatile bool stop_called = false;
|
||||
AsioTimer stop_timer;
|
||||
AsioTimerSafe stop_timer;
|
||||
|
||||
// hold
|
||||
bool hold_wait = false;
|
||||
|
Loading…
Reference in New Issue
Block a user