diff --git a/client/SDL/SDL2/dialogs/sdl_dialogs.cpp b/client/SDL/SDL2/dialogs/sdl_dialogs.cpp index aa65abfa1..c12ca7753 100644 --- a/client/SDL/SDL2/dialogs/sdl_dialogs.cpp +++ b/client/SDL/SDL2/dialogs/sdl_dialogs.cpp @@ -253,7 +253,7 @@ SSIZE_T sdl_retry_dialog(freerdp* instance, const char* what, size_t current, sdl->connection_dialog->showInfo("[%s] retry %" PRIuz "/%" PRIuz ", delaying %" PRIuz "ms before next attempt", - what, current, max, delay); + what, current + 1, max, delay); return WINPR_ASSERTING_INT_CAST(SSIZE_T, delay); } diff --git a/client/SDL/SDL3/dialogs/sdl_dialogs.cpp b/client/SDL/SDL3/dialogs/sdl_dialogs.cpp index 1525567a1..bbbbcd5c2 100644 --- a/client/SDL/SDL3/dialogs/sdl_dialogs.cpp +++ b/client/SDL/SDL3/dialogs/sdl_dialogs.cpp @@ -246,7 +246,7 @@ SSIZE_T sdl_retry_dialog(freerdp* instance, const char* what, size_t current, sdl->dialog.showInfo("[%s] retry %" PRIuz "/%" PRIuz ", delaying %" PRIuz "ms before next attempt", - what, current, max, delay); + what, current + 1, max, delay); return WINPR_ASSERTING_INT_CAST(ssize_t, delay); } diff --git a/client/common/client.c b/client/common/client.c index 5bcf8f8e5..06912abc9 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -1299,7 +1299,7 @@ SSIZE_T client_common_retry_dialog(freerdp* instance, const char* what, size_t c } WLog_INFO(TAG, "[%s] retry %" PRIuz "/%" PRIuz ", delaying %" PRIuz "ms before next attempt", - what, current, max, delay); + what, current + 1, max, delay); return WINPR_ASSERTING_INT_CAST(SSIZE_T, delay); } @@ -1364,7 +1364,7 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp* while (retry) { /* Quit retrying if max retries has been exceeded */ - if ((maxRetries > 0) && (numRetries++ >= maxRetries)) + if ((maxRetries > 0) && (numRetries >= maxRetries)) { WLog_DBG(TAG, "AutoReconnect retries exceeded."); return FALSE; @@ -1375,6 +1375,9 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp* const SSIZE_T delay = IFCALLRESULT(5000, instance->RetryDialog, instance, "connection", numRetries, NULL); + if (delay < 0) + return FALSE; + numRetries++; if (freerdp_reconnect(instance)) return TRUE;