mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
Fix interactive service ignoring stop command if openvpn is running
Make the exit event not auto-reset so that the signal propagates to all worker threads and finally to the main thread. Fixes Trac #666 Signed-off-by: Selva Nair <selva.nair@gmail.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1457241559-23374-1-git-send-email-selva.nair@gmail.com> URL: http://article.gmane.org/gmane.network.openvpn.devel/11317 Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
6370f70357
commit
239d09938b
1 changed files with 2 additions and 1 deletions
|
|
@ -1289,7 +1289,7 @@ ServiceStartInteractive (DWORD dwArgc, LPTSTR *lpszArgv)
|
|||
goto out;
|
||||
|
||||
io_event = InitOverlapped (&overlapped);
|
||||
exit_event = CreateEvent (NULL, FALSE, FALSE, NULL);
|
||||
exit_event = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||
if (!exit_event || !io_event)
|
||||
{
|
||||
error = MsgToEventLog (M_SYSERR, TEXT("Could not create event"));
|
||||
|
|
@ -1356,6 +1356,7 @@ ServiceStartInteractive (DWORD dwArgc, LPTSTR *lpszArgv)
|
|||
{
|
||||
/* exit event signaled */
|
||||
CloseHandleEx (&pipe);
|
||||
ResetEvent (exit_event);
|
||||
error = NO_ERROR;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue