Merge pull request #4745 from akallabeth/redirect_fix_follow_up

Fixed channel reconnect after redirect.
This commit is contained in:
Martin Fleisz 2018-07-13 13:54:03 +02:00 committed by GitHub
commit 7705535f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -353,7 +353,7 @@ BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp)
return TRUE; return TRUE;
} }
static BOOL rdp_client_reconnect_channels(rdpRdp* rdp) static BOOL rdp_client_reconnect_channels(rdpRdp* rdp, BOOL redirect)
{ {
BOOL status; BOOL status;
rdpContext* context; rdpContext* context;
@ -370,6 +370,9 @@ static BOOL rdp_client_reconnect_channels(rdpRdp* rdp)
if (context->instance->ConnectionCallbackState == CLIENT_STATE_PRECONNECT_PASSED) if (context->instance->ConnectionCallbackState == CLIENT_STATE_PRECONNECT_PASSED)
{ {
if (redirect)
return TRUE;
if (!IFCALLRESULT(FALSE, context->instance->PostConnect, context->instance)) if (!IFCALLRESULT(FALSE, context->instance->PostConnect, context->instance))
return FALSE; return FALSE;
@ -456,7 +459,7 @@ BOOL rdp_client_redirect(rdpRdp* rdp)
status = rdp_client_connect(rdp); status = rdp_client_connect(rdp);
if (status) if (status)
status = rdp_client_reconnect_channels(rdp); status = rdp_client_reconnect_channels(rdp, TRUE);
return status; return status;
} }
@ -479,7 +482,7 @@ BOOL rdp_client_reconnect(rdpRdp* rdp)
status = rdp_client_connect(rdp); status = rdp_client_connect(rdp);
if (status) if (status)
status = rdp_client_reconnect_channels(rdp); status = rdp_client_reconnect_channels(rdp, FALSE);
return status; return status;
} }

View File

@ -218,6 +218,8 @@ BOOL freerdp_connect(freerdp* instance)
{ {
if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_CONNECT_TRANSPORT_FAILED) if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_CONNECT_TRANSPORT_FAILED)
status = freerdp_reconnect(instance); status = freerdp_reconnect(instance);
else
goto freerdp_connect_finally;
} }
if (!status || (status2 != CHANNEL_RC_OK) if (!status || (status2 != CHANNEL_RC_OK)