[core,autodetect] revert to [MS-RDPBCGR] states
remove 'convenience' states in main RDP state machine for autodetect
This commit is contained in:
parent
f357f1d418
commit
4d3d1bfe4d
@ -52,10 +52,8 @@ extern "C"
|
||||
CONNECTION_STATE_MCS_CHANNEL_JOIN_RESPONSE,
|
||||
CONNECTION_STATE_RDP_SECURITY_COMMENCEMENT,
|
||||
CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE,
|
||||
CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN,
|
||||
CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_REQUEST,
|
||||
CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS,
|
||||
CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END,
|
||||
CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_RESPONSE,
|
||||
CONNECTION_STATE_LICENSING,
|
||||
CONNECTION_STATE_MULTITRANSPORT_BOOTSTRAPPING_REQUEST,
|
||||
CONNECTION_STATE_MULTITRANSPORT_BOOTSTRAPPING_RESPONSE,
|
||||
|
@ -1787,14 +1787,10 @@ const char* rdp_state_string(CONNECTION_STATE state)
|
||||
return "CONNECTION_STATE_RDP_SECURITY_COMMENCEMENT";
|
||||
case CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE:
|
||||
return "CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE";
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN:
|
||||
return "CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN";
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_REQUEST:
|
||||
return "CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_REQUEST";
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS:
|
||||
return "CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS";
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END:
|
||||
return "CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END";
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_RESPONSE:
|
||||
return "CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_RESPONSE";
|
||||
case CONNECTION_STATE_LICENSING:
|
||||
return "CONNECTION_STATE_LICENSING";
|
||||
case CONNECTION_STATE_MULTITRANSPORT_BOOTSTRAPPING_REQUEST:
|
||||
|
@ -537,57 +537,63 @@ static state_run_t peer_recv_handle_auto_detect(freerdp_peer* client, wStream* s
|
||||
rdp = client->context->rdp;
|
||||
WINPR_ASSERT(rdp);
|
||||
|
||||
switch (rdp_get_state(rdp))
|
||||
const rdpSettings* settings = client->context->settings;
|
||||
WINPR_ASSERT(settings);
|
||||
|
||||
if (freerdp_settings_get_bool(settings, FreeRDP_NetworkAutoDetect))
|
||||
{
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN:
|
||||
autodetect_on_connect_time_auto_detect_begin(rdp->autodetect);
|
||||
switch (autodetect_get_state(rdp->autodetect))
|
||||
{
|
||||
case FREERDP_AUTODETECT_STATE_REQUEST:
|
||||
ret = STATE_RUN_SUCCESS;
|
||||
if (!rdp_server_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS))
|
||||
return STATE_RUN_FAILED;
|
||||
break;
|
||||
case FREERDP_AUTODETECT_STATE_COMPLETE:
|
||||
ret = STATE_RUN_CONTINUE; /* Rerun in next state */
|
||||
if (!rdp_server_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END))
|
||||
return STATE_RUN_FAILED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS:
|
||||
ret = peer_recv_pdu(client, s);
|
||||
if (state_run_success(ret))
|
||||
{
|
||||
autodetect_on_connect_time_auto_detect_progress(rdp->autodetect);
|
||||
switch (rdp_get_state(rdp))
|
||||
{
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_REQUEST:
|
||||
autodetect_on_connect_time_auto_detect_begin(rdp->autodetect);
|
||||
switch (autodetect_get_state(rdp->autodetect))
|
||||
{
|
||||
case FREERDP_AUTODETECT_STATE_REQUEST:
|
||||
ret = STATE_RUN_SUCCESS;
|
||||
if (!rdp_server_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_RESPONSE))
|
||||
return STATE_RUN_FAILED;
|
||||
break;
|
||||
case FREERDP_AUTODETECT_STATE_COMPLETE:
|
||||
ret = STATE_RUN_CONTINUE; /* Rerun in next state */
|
||||
if (!rdp_server_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END))
|
||||
if (!rdp_server_transition_to_state(rdp, CONNECTION_STATE_LICENSING))
|
||||
return STATE_RUN_FAILED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END:
|
||||
if (!rdp_server_transition_to_state(rdp, CONNECTION_STATE_LICENSING))
|
||||
return STATE_RUN_FAILED;
|
||||
ret = STATE_RUN_CONTINUE; /* Rerun in next state */
|
||||
break;
|
||||
default:
|
||||
WINPR_ASSERT(FALSE);
|
||||
break;
|
||||
break;
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_RESPONSE:
|
||||
ret = peer_recv_pdu(client, s);
|
||||
if (state_run_success(ret))
|
||||
{
|
||||
autodetect_on_connect_time_auto_detect_progress(rdp->autodetect);
|
||||
switch (autodetect_get_state(rdp->autodetect))
|
||||
{
|
||||
case FREERDP_AUTODETECT_STATE_REQUEST:
|
||||
ret = STATE_RUN_SUCCESS;
|
||||
break;
|
||||
case FREERDP_AUTODETECT_STATE_COMPLETE:
|
||||
ret = STATE_RUN_CONTINUE; /* Rerun in next state */
|
||||
if (!rdp_server_transition_to_state(rdp, CONNECTION_STATE_LICENSING))
|
||||
return STATE_RUN_FAILED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WINPR_ASSERT(FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!rdp_server_transition_to_state(rdp, CONNECTION_STATE_LICENSING))
|
||||
return STATE_RUN_FAILED;
|
||||
|
||||
ret = STATE_RUN_CONTINUE; /* Rerun in next state */
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -919,23 +925,14 @@ static state_run_t peer_recv_callback_internal(rdpTransport* transport, wStream*
|
||||
case CONNECTION_STATE_SECURE_SETTINGS_EXCHANGE:
|
||||
if (rdp_recv_client_info(rdp, s))
|
||||
{
|
||||
if (freerdp_settings_get_bool(settings, FreeRDP_NetworkAutoDetect))
|
||||
{
|
||||
if (rdp_server_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN))
|
||||
ret = STATE_RUN_CONTINUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rdp_server_transition_to_state(rdp, CONNECTION_STATE_LICENSING))
|
||||
ret = STATE_RUN_CONTINUE;
|
||||
}
|
||||
if (rdp_server_transition_to_state(
|
||||
rdp, CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_REQUEST))
|
||||
ret = STATE_RUN_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_BEGIN:
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_IN_PROGRESS:
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_END:
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_REQUEST:
|
||||
case CONNECTION_STATE_CONNECT_TIME_AUTO_DETECT_RESPONSE:
|
||||
ret = peer_recv_handle_auto_detect(client, s);
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user