From 87e6cef7d90c48273c0de2100d528679ed0f6624 Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Thu, 30 Jun 2022 18:01:27 -0400 Subject: [PATCH] Bugfix for management-timeout patch PR 418 introduced repeatedly trying to connect to the management interface on timeout. User can exit out of this loop by "disconnect", but for this to work an explict call to OnStop() is required. Normally OnStop() is triggered by management disconnect which won't happen if not connected in the first place. Also call OnStop() on all iservice errors instead of waiting for management timeout which may never happen. Signed-off-by: Selva Nair --- openvpn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openvpn.c b/openvpn.c index 39657d2..c6d579e 100644 --- a/openvpn.c +++ b/openvpn.c @@ -1709,7 +1709,7 @@ OnService(connection_t *c, UNUSED char *msg) OnStop(c, NULL); break; default: - /* Unknown failure: let management connection timeout */ + OnStop(c, NULL); break; } } @@ -2065,6 +2065,7 @@ StatusDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) /* openvpn failed to respond to stop signal -- terminate */ TerminateOpenVPN(c); KillTimer (hwndDlg, IDT_STOP_TIMER); + OnStop(c, NULL); } break;