From: Selva Nair Date: Sun, 6 Mar 2016 05:19:19 +0000 (-0500) Subject: Fix interactive service ignoring stop command if openvpn is running X-Git-Tag: v2.4_alpha1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=239d09938b300f8eafa12bfb8c43373f0215f7bd;p=thirdparty%2Fopenvpn.git 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 Acked-by: Gert Doering 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 --- diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 22239b273..39397d12a 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -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; }