Do not clear last error if not reconnecting.
This commit is contained in:
parent
7af9ba9171
commit
685f5a8d20
@ -331,7 +331,19 @@ BOOL rdp_client_disconnect(rdpRdp* rdp)
|
||||
if (freerdp_channels_disconnect(context->channels, context->instance) != CHANNEL_RC_OK)
|
||||
return FALSE;
|
||||
|
||||
freerdp_set_last_error(context, FREERDP_ERROR_SUCCESS);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp)
|
||||
{
|
||||
rdpContext* context;
|
||||
|
||||
if (!rdp_client_disconnect(rdp))
|
||||
return FALSE;
|
||||
|
||||
context = rdp->context;
|
||||
|
||||
context->LastError = FREERDP_ERROR_SUCCESS;
|
||||
clearChannelError(context);
|
||||
ResetEvent(context->abortEvent);
|
||||
return TRUE;
|
||||
@ -343,7 +355,7 @@ BOOL rdp_client_redirect(rdpRdp* rdp)
|
||||
rdpSettings* settings;
|
||||
rdpContext* context;
|
||||
|
||||
if (!rdp_client_disconnect(rdp))
|
||||
if (!rdp_client_disconnect_and_clear(rdp))
|
||||
return FALSE;
|
||||
|
||||
settings = rdp->settings;
|
||||
@ -417,7 +429,7 @@ BOOL rdp_client_reconnect(rdpRdp* rdp)
|
||||
rdpContext* context = rdp->context;
|
||||
rdpChannels* channels = context->channels;
|
||||
|
||||
if (!rdp_client_disconnect(rdp))
|
||||
if (!rdp_client_disconnect_and_clear(rdp))
|
||||
return FALSE;
|
||||
|
||||
status = rdp_client_connect(rdp);
|
||||
|
@ -51,6 +51,7 @@ enum CONNECTION_STATE
|
||||
|
||||
FREERDP_LOCAL BOOL rdp_client_connect(rdpRdp* rdp);
|
||||
FREERDP_LOCAL BOOL rdp_client_disconnect(rdpRdp* rdp);
|
||||
FREERDP_LOCAL BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp);
|
||||
FREERDP_LOCAL BOOL rdp_client_reconnect(rdpRdp* rdp);
|
||||
FREERDP_LOCAL BOOL rdp_client_redirect(rdpRdp* rdp);
|
||||
FREERDP_LOCAL BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp,
|
||||
|
@ -158,7 +158,7 @@ BOOL freerdp_connect(freerdp* instance)
|
||||
|
||||
/* We always set the return code to 0 before we start the connect sequence*/
|
||||
connectErrorCode = 0;
|
||||
freerdp_set_last_error(instance->context, FREERDP_ERROR_SUCCESS);
|
||||
instance->context->LastError = FREERDP_ERROR_SUCCESS;
|
||||
clearChannelError(instance->context);
|
||||
ResetEvent(instance->context->abortEvent);
|
||||
rdp = instance->context->rdp;
|
||||
@ -517,7 +517,7 @@ BOOL freerdp_disconnect(freerdp* instance)
|
||||
BOOL freerdp_disconnect_before_reconnect(freerdp* instance)
|
||||
{
|
||||
rdpRdp* rdp = instance->context->rdp;
|
||||
return rdp_client_disconnect(rdp);
|
||||
return rdp_client_disconnect_and_clear(rdp);
|
||||
}
|
||||
|
||||
BOOL freerdp_reconnect(freerdp* instance)
|
||||
|
Loading…
x
Reference in New Issue
Block a user