From 9b8d16b33205f71a8376b60dabcf57e4514be4b7 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 26 Nov 2020 15:38:17 +0100 Subject: [PATCH] Allow autoreconnect for ERRINFO_GRAPHICS_SUBSYSTEM_FAILED As discussed in #4717 allow autoreconnect to succeed if that specific error code was returned as disconnection reason. --- client/common/client.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/client/common/client.c b/client/common/client.c index cccc97401..0cdb636d8 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -730,6 +730,7 @@ BOOL client_auto_reconnect(freerdp* instance) BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp* instance)) { + UINT32 error; UINT32 maxRetries; UINT32 numRetries = 0; rdpSettings* settings; @@ -741,11 +742,21 @@ BOOL client_auto_reconnect_ex(freerdp* instance, BOOL (*window_events)(freerdp* maxRetries = settings->AutoReconnectMaxRetries; /* Only auto reconnect on network disconnects. */ - if (freerdp_error_info(instance) != 0) - return FALSE; - - /* A network disconnect was detected */ - WLog_INFO(TAG, "Network disconnect!"); + error = freerdp_error_info(instance); + switch (error) + { + case ERRINFO_GRAPHICS_SUBSYSTEM_FAILED: + /* A network disconnect was detected */ + WLog_WARN(TAG, "Disconnected by server hitting a bug or resource limit [%s]", + freerdp_get_error_info_string(error)); + break; + case ERRINFO_SUCCESS: + /* A network disconnect was detected */ + WLog_INFO(TAG, "Network disconnect!"); + break; + default: + return FALSE; + } if (!settings->AutoReconnectionEnabled) {