Fixed rdp_client_disconnect and rdp_reset.

This commit is contained in:
Armin Novak 2015-01-12 13:36:38 +01:00
parent 5d3091bd1c
commit 9274de4921

View File

@ -289,7 +289,7 @@ BOOL rdp_client_connect(rdpRdp* rdp)
{ {
if (!connectErrorCode) if (!connectErrorCode)
{ {
connectErrorCode = MCSCONNECTINITIALERROR; connectErrorCode = MCSCONNECTINITIALERROR;
} }
if (!freerdp_get_last_error(rdp->context)) if (!freerdp_get_last_error(rdp->context))
@ -319,7 +319,18 @@ BOOL rdp_client_connect(rdpRdp* rdp)
BOOL rdp_client_disconnect(rdpRdp* rdp) BOOL rdp_client_disconnect(rdpRdp* rdp)
{ {
return transport_disconnect(rdp->transport); BOOL rc;
if (rdp->settingsCopy)
{
freerdp_settings_free(rdp->settingsCopy);
rdp->settingsCopy = NULL;
}
rc = nego_disconnect(rdp->nego);
rdp_reset(rdp);
rdp_client_transition_to_state(rdp, CONNECTION_STATE_INITIAL);
return rc;
} }
BOOL rdp_client_redirect(rdpRdp* rdp) BOOL rdp_client_redirect(rdpRdp* rdp)
@ -328,9 +339,6 @@ BOOL rdp_client_redirect(rdpRdp* rdp)
rdpSettings* settings = rdp->settings; rdpSettings* settings = rdp->settings;
rdp_client_disconnect(rdp); rdp_client_disconnect(rdp);
rdp_reset(rdp);
rdp_redirection_apply_settings(rdp); rdp_redirection_apply_settings(rdp);
if (settings->RedirectionFlags & LB_LOAD_BALANCE_INFO) if (settings->RedirectionFlags & LB_LOAD_BALANCE_INFO)
@ -376,9 +384,6 @@ BOOL rdp_client_redirect(rdpRdp* rdp)
BOOL rdp_client_reconnect(rdpRdp* rdp) BOOL rdp_client_reconnect(rdpRdp* rdp)
{ {
rdp_client_disconnect(rdp); rdp_client_disconnect(rdp);
rdp_reset(rdp);
return rdp_client_connect(rdp); return rdp_client_connect(rdp);
} }
@ -758,7 +763,7 @@ BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, wStream* s)
return TRUE; return TRUE;
} }
BOOL rdp_client_connect_auto_detect(rdpRdp* rdp, wStream *s) BOOL rdp_client_connect_auto_detect(rdpRdp* rdp, wStream* s)
{ {
BYTE* mark; BYTE* mark;
UINT16 length; UINT16 length;
@ -1153,7 +1158,6 @@ BOOL rdp_server_reactivate(rdpRdp* rdp)
return FALSE; return FALSE;
rdp->AwaitCapabilities = TRUE; rdp->AwaitCapabilities = TRUE;
return TRUE; return TRUE;
} }
@ -1239,7 +1243,6 @@ int rdp_server_transition_to_state(rdpRdp* rdp, int state)
* PostConnect should only be called once and should not * PostConnect should only be called once and should not
* be called after a reactivation sequence. * be called after a reactivation sequence.
*/ */
IFCALLRET(client->PostConnect, client->connected, client); IFCALLRET(client->PostConnect, client->connected, client);
if (!client->connected) if (!client->connected)