diff options
Diffstat (limited to 'libfreerdp/core/connection.c')
-rw-r--r-- | libfreerdp/core/connection.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 3abfa93..240a29f 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -622,11 +622,10 @@ BOOL rdp_client_redirect(rdpRdp* rdp) if (!rdp_client_disconnect_and_clear(rdp)) return FALSE; + /* Only disconnect & close the channels here. + * they will be discarded and recreated after the new settings have been applied. */ freerdp_channels_disconnect(rdp->context->channels, rdp->context->instance); freerdp_channels_close(rdp->context->channels, rdp->context->instance); - freerdp_channels_free(rdp->context->channels); - rdp->context->channels = freerdp_channels_new(rdp->context->instance); - WINPR_ASSERT(rdp->context->channels); if (rdp_redirection_apply_settings(rdp) != 0) return FALSE; @@ -684,14 +683,10 @@ BOOL rdp_client_redirect(rdpRdp* rdp) if (!IFCALLRESULT(TRUE, rdp->context->instance->Redirect, rdp->context->instance)) return FALSE; - BOOL ok = IFCALLRESULT(TRUE, rdp->context->instance->LoadChannels, rdp->context->instance); + BOOL ok = utils_reload_channels(rdp->context); if (!ok) return FALSE; - if (CHANNEL_RC_OK != - freerdp_channels_pre_connect(rdp->context->channels, rdp->context->instance)) - return FALSE; - status = rdp_client_connect(rdp); if (status) @@ -782,7 +777,6 @@ static BOOL rdp_client_establish_keys(rdpRdp* rdp) Stream_Zero(s, 8); Stream_SealLength(s); status = transport_write(rdp->mcs->transport, s); - Stream_Free(s, TRUE); if (status < 0) goto end; @@ -829,6 +823,7 @@ static BOOL rdp_client_establish_keys(rdpRdp* rdp) ret = TRUE; end: + Stream_Free(s, TRUE); free(crypt_client_random); if (!ret) |