mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
omi\openvpn.cpp: cancel wait on exit event
When OMI is stopped, we must cancel wait on exit event, otherwise ASIO won't terminate event loop and process won't exit. Signed-off-by: Lev Stipakov <lev@openvpn.net>
This commit is contained in:
parent
516b32c2b8
commit
aaafb33d30
@ -125,9 +125,12 @@ public:
|
||||
if (!exit_event_name.empty())
|
||||
{
|
||||
exit_event.assign(::CreateEvent(NULL, FALSE, FALSE, exit_event_name.c_str()));
|
||||
exit_event.async_wait([self = Ptr(this)](const openvpn_io::error_code& error) {
|
||||
self->stop();
|
||||
});
|
||||
exit_event.async_wait([self = Ptr(this)](const openvpn_io::error_code& error)
|
||||
{
|
||||
if (error)
|
||||
return;
|
||||
self->stop();
|
||||
});
|
||||
}
|
||||
|
||||
// http-proxy-override
|
||||
@ -641,6 +644,10 @@ private:
|
||||
// in case connect thread is blocking in external_pki_sign_request
|
||||
async_stop.stop();
|
||||
|
||||
// cancel wait on exit_event
|
||||
if (exit_event.is_open())
|
||||
exit_event.cancel();
|
||||
|
||||
// stop timers
|
||||
reconnect_timer.cancel();
|
||||
bytecount_timer.cancel();
|
||||
|
Loading…
Reference in New Issue
Block a user