If the user terminates OpenConnect with Ctrl+C, the session will be
logged off (OC_CMD_CANCEL), and with Ctrl+Break the session will NOT
be logged off (OC_CMD_DETACH). Either way, the vpnc-script
will still be invoked with reason=disconnect.
Signed-off-by: Tim De Baets <10608063-tdebaets@users.noreply.gitlab.com>
switch (dwCtrlType) {
case CTRL_C_EVENT:
- case CTRL_BREAK_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
cmd = OC_CMD_CANCEL;
break;
+ case CTRL_BREAK_EVENT:
+ cmd = OC_CMD_DETACH;
+ break;
default:
return FALSE;
}