Merge pull request #11996 from akallabeth/retry-count-fix

[client,common] fix retry counter
This commit is contained in:
akallabeth
2025-11-13 15:30:28 +01:00
committed by GitHub
3 changed files with 7 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;