Fixed /gt:xxx settings (#7808)

* Disable websocket support with RPC
* Use settings getter/setter
This commit is contained in:
akallabeth 2022-04-19 14:47:57 +02:00 committed by GitHub
parent 73cdcdfe09
commit f99491c354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2202,8 +2202,10 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
if (_stricmp(arg->Value, "rpc") == 0)
{
settings->GatewayRpcTransport = TRUE;
settings->GatewayHttpTransport = FALSE;
if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayRpcTransport, TRUE) ||
!freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpTransport, FALSE) ||
!freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpUseWebsockets, FALSE))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
else
{
@ -2212,21 +2214,24 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
*c++ = '\0';
if (_stricmp(c, "no-websockets") != 0)
{
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpUseWebsockets, FALSE);
if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpUseWebsockets,
FALSE))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
if (_stricmp(arg->Value, "http") == 0)
{
settings->GatewayRpcTransport = FALSE;
settings->GatewayHttpTransport = TRUE;
if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayRpcTransport, FALSE) ||
!freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpTransport, TRUE))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
else if (_stricmp(arg->Value, "auto") == 0)
{
settings->GatewayRpcTransport = TRUE;
settings->GatewayHttpTransport = TRUE;
if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayRpcTransport, TRUE) ||
!freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpTransport, TRUE))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
}
}