mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[client,common] auto reconnect abort early on cancel
This commit is contained in:
committed by
Martin Fleisz
parent
2ec4601669
commit
d4fc9d5327
@@ -1526,8 +1526,10 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
|
||||
* Indicate an unsuccessful connection attempt if reconnect
|
||||
* did not succeed and no other error was specified.
|
||||
*/
|
||||
const UINT32 error = freerdp_get_last_error(instance->context);
|
||||
|
||||
if (freerdp_error_info(instance) == 0)
|
||||
exit_code = XF_EXIT_CONN_FAILED;
|
||||
exit_code = xf_map_error_to_exit_code(error);
|
||||
}
|
||||
|
||||
if (freerdp_get_last_error(context) == FREERDP_ERROR_SUCCESS)
|
||||
|
||||
@@ -1034,11 +1034,18 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp*
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch (freerdp_get_last_error(instance->context))
|
||||
{
|
||||
case FREERDP_ERROR_CONNECT_CANCELLED:
|
||||
WLog_WARN(TAG, "Connection aborted by user");
|
||||
return FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Perform an auto-reconnect. */
|
||||
while (retry)
|
||||
{
|
||||
UINT32 x;
|
||||
|
||||
/* Quit retrying if max retries has been exceeded */
|
||||
if ((maxRetries > 0) && (numRetries++ >= maxRetries))
|
||||
{
|
||||
@@ -1055,12 +1062,11 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp*
|
||||
{
|
||||
case FREERDP_ERROR_CONNECT_CANCELLED:
|
||||
WLog_WARN(TAG, "Autoreconnect aborted by user");
|
||||
retry = FALSE;
|
||||
break;
|
||||
return FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (x = 0; x < 50; x++)
|
||||
for (UINT32 x = 0; x < 50; x++)
|
||||
{
|
||||
if (!IFCALLRESULT(TRUE, window_events, instance))
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user