|
|
|
@ -220,6 +220,7 @@ OnStateChange(connection_t *c, char *data)
|
|
|
|
|
/* Save time when we got connected. */
|
|
|
|
|
c->connected_since = atoi(data);
|
|
|
|
|
c->failed_psw_attempts = 0;
|
|
|
|
|
c->failed_auth_attempts = 0;
|
|
|
|
|
c->state = connected;
|
|
|
|
|
|
|
|
|
|
SetMenuStatus(c, connected);
|
|
|
|
@ -235,7 +236,9 @@ OnStateChange(connection_t *c, char *data)
|
|
|
|
|
{
|
|
|
|
|
if (!c->dynamic_cr)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(message, "auth-failure") == 0 || strcmp(message, "private-key-password-failure") == 0)
|
|
|
|
|
if (strcmp(message, "auth-failure") == 0)
|
|
|
|
|
c->failed_auth_attempts++;
|
|
|
|
|
else if (strcmp(message, "private-key-password-failure") == 0)
|
|
|
|
|
c->failed_psw_attempts++;
|
|
|
|
|
|
|
|
|
|
if (strcmp(message, "auth-failure") == 0 && (c->flags & FLAG_SAVE_AUTH_PASS))
|
|
|
|
@ -848,6 +851,7 @@ OnStop(connection_t *c, UNUSED char *msg)
|
|
|
|
|
case connected:
|
|
|
|
|
/* OpenVPN process ended unexpectedly */
|
|
|
|
|
c->failed_psw_attempts = 0;
|
|
|
|
|
c->failed_auth_attempts = 0;
|
|
|
|
|
c->state = disconnected;
|
|
|
|
|
CheckAndSetTrayIcon();
|
|
|
|
|
SetDlgItemText(c->hwndStatus, ID_TXT_STATUS, LoadLocalizedString(IDS_NFO_STATE_DISCONNECTED));
|
|
|
|
@ -909,6 +913,7 @@ OnStop(connection_t *c, UNUSED char *msg)
|
|
|
|
|
// }
|
|
|
|
|
/* Shutdown was initiated by us */
|
|
|
|
|
c->failed_psw_attempts = 0;
|
|
|
|
|
c->failed_auth_attempts = 0;
|
|
|
|
|
c->state = disconnected;
|
|
|
|
|
CheckAndSetTrayIcon();
|
|
|
|
|
SendMessage(c->hwndStatus, WM_CLOSE, 0, 0);
|
|
|
|
|