From f99491c354f9f2f14dc8a940761e0f58e5448507 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 19 Apr 2022 14:47:57 +0200 Subject: [PATCH] Fixed /gt:xxx settings (#7808) * Disable websocket support with RPC * Use settings getter/setter --- client/common/cmdline.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 25f60bd20..fb3af5d80 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -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; } } }