mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[core,client] handle optional monitor layout PDU
The monitor layout PDU is optional. If that was not received assume it will not be sent and continue in next state.
This commit is contained in:
@@ -185,7 +185,6 @@
|
||||
*channel messages (exchanged between client-side plug-ins and server-side applications).
|
||||
*/
|
||||
|
||||
static state_run_t rdp_client_connect_finalize(rdpRdp* rdp);
|
||||
static BOOL rdp_set_state(rdpRdp* rdp, CONNECTION_STATE state);
|
||||
|
||||
static BOOL rdp_client_reset_codecs(rdpContext* context)
|
||||
@@ -1811,6 +1810,12 @@ BOOL rdp_channels_from_mcs(rdpSettings* settings, const rdpRdp* rdp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Here we are in client state CONFIRM_ACTIVE.
|
||||
*
|
||||
* This means:
|
||||
* 1. send the CONFIRM_ACTIVE PDU to the server
|
||||
* 2. register callbacks, the server can now start sending stuff
|
||||
*/
|
||||
state_run_t rdp_client_connect_confirm_active(rdpRdp* rdp, wStream* s)
|
||||
{
|
||||
WINPR_ASSERT(rdp);
|
||||
@@ -1854,5 +1859,14 @@ state_run_t rdp_client_connect_confirm_active(rdpRdp* rdp, wStream* s)
|
||||
if (freerdp_shall_disconnect_context(rdp->context))
|
||||
return STATE_RUN_SUCCESS;
|
||||
|
||||
return rdp_client_connect_finalize(rdp);
|
||||
state_run_t status = STATE_RUN_SUCCESS;
|
||||
if (!rdp->settings->SupportMonitorLayoutPdu)
|
||||
status = rdp_client_connect_finalize(rdp);
|
||||
else
|
||||
{
|
||||
if (!rdp_client_transition_to_state(rdp,
|
||||
CONNECTION_STATE_CAPABILITIES_EXCHANGE_MONITOR_LAYOUT))
|
||||
status = STATE_RUN_FAILED;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ FREERDP_LOCAL BOOL rdp_client_connect_auto_detect(rdpRdp* rdp, wStream* s);
|
||||
FREERDP_LOCAL state_run_t rdp_client_connect_license(rdpRdp* rdp, wStream* s);
|
||||
FREERDP_LOCAL state_run_t rdp_client_connect_demand_active(rdpRdp* rdp, wStream* s);
|
||||
FREERDP_LOCAL state_run_t rdp_client_connect_confirm_active(rdpRdp* rdp, wStream* s);
|
||||
FREERDP_LOCAL state_run_t rdp_client_connect_finalize(rdpRdp* rdp);
|
||||
FREERDP_LOCAL BOOL rdp_client_transition_to_state(rdpRdp* rdp, CONNECTION_STATE state);
|
||||
|
||||
FREERDP_LOCAL CONNECTION_STATE rdp_get_state(const rdpRdp* rdp);
|
||||
|
||||
@@ -1648,6 +1648,24 @@ static state_run_t rdp_handle_sc_flags(rdpRdp* rdp, wStream* s, UINT32 flag,
|
||||
return status;
|
||||
}
|
||||
|
||||
static state_run_t rdp_client_exchange_monitor_layout(rdpRdp* rdp, wStream* s)
|
||||
{
|
||||
WINPR_ASSERT(rdp);
|
||||
|
||||
const UINT32 old = rdp->finalize_sc_pdus;
|
||||
state_run_t status = rdp_recv_pdu(rdp, s);
|
||||
|
||||
/* This PDU is optional, so if we received a finalize PDU continue there */
|
||||
if (state_run_success(status))
|
||||
{
|
||||
const BOOL changed = old != rdp->finalize_sc_pdus;
|
||||
status = rdp_client_connect_finalize(rdp);
|
||||
if (changed && state_run_success(status))
|
||||
status = STATE_RUN_TRY_AGAIN;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
static state_run_t rdp_recv_callback_int(rdpTransport* transport, wStream* s, void* extra)
|
||||
{
|
||||
state_run_t status = STATE_RUN_SUCCESS;
|
||||
@@ -1845,32 +1863,16 @@ static state_run_t rdp_recv_callback_int(rdpTransport* transport, wStream* s, vo
|
||||
}
|
||||
else if (status != STATE_RUN_REDIRECT)
|
||||
{
|
||||
if (!rdp->settings->SupportMonitorLayoutPdu)
|
||||
{
|
||||
if (!rdp_client_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE_CONFIRM_ACTIVE))
|
||||
status = STATE_RUN_FAILED;
|
||||
else
|
||||
status = STATE_RUN_CONTINUE;
|
||||
}
|
||||
if (!rdp_client_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE_CONFIRM_ACTIVE))
|
||||
status = STATE_RUN_FAILED;
|
||||
else
|
||||
{
|
||||
if (!rdp_client_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE_MONITOR_LAYOUT))
|
||||
status = STATE_RUN_FAILED;
|
||||
}
|
||||
status = STATE_RUN_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case CONNECTION_STATE_CAPABILITIES_EXCHANGE_MONITOR_LAYOUT:
|
||||
status = rdp_recv_pdu(rdp, s);
|
||||
if (state_run_success(status))
|
||||
{
|
||||
status = STATE_RUN_TRY_AGAIN;
|
||||
if (!rdp_client_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE_CONFIRM_ACTIVE))
|
||||
status = STATE_RUN_FAILED;
|
||||
}
|
||||
status = rdp_client_exchange_monitor_layout(rdp, s);
|
||||
break;
|
||||
|
||||
case CONNECTION_STATE_CAPABILITIES_EXCHANGE_CONFIRM_ACTIVE:
|
||||
|
||||
Reference in New Issue
Block a user