Skip to content

Commit

Permalink
[client,common] add option to set timezone
Browse files Browse the repository at this point in the history
/timezone now allows setting the timezone used from an IANA string
  • Loading branch information
akallabeth committed May 13, 2024
1 parent 768adaf commit f1aa0df
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions client/common/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -4609,6 +4609,22 @@ static int freerdp_client_settings_parse_command_line_arguments_int(
if (!freerdp_settings_set_uint32(settings, FreeRDP_TcpAckTimeout, (UINT32)val))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
CommandLineSwitchCase(arg, "timezone")
{
TIME_ZONE_INFORMATION* ctz = winpr_GetWindowsTimezoneFromIANA(arg->Value);
if (!ctz)
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;

TIME_ZONE_INFORMATION* tz =
freerdp_settings_get_pointer_writable(settings, FreeRDP_ClientTimeZone);
if (!tz)
{
free(ctz);
return COMMAND_LINE_ERROR_MEMORY;
}
*tz = *ctz;
free(ctz);
}
CommandLineSwitchCase(arg, "aero")
{
if (!freerdp_settings_set_bool(settings, FreeRDP_AllowDesktopComposition, enable))
Expand Down
2 changes: 2 additions & 0 deletions client/common/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = {
{ "timeout", COMMAND_LINE_VALUE_REQUIRED, "<time in ms>", "9000", NULL, -1, "timeout",
"Advanced setting for high latency links: Adjust connection timeout, use if you encounter "
"timeout failures with your connection" },
{ "timezone", COMMAND_LINE_VALUE_REQUIRED, "<IANA timezone>", NULL, NULL, -1, NULL,
"Use supplied IANA timezone for connection (requires server support)" },
{ "tls", COMMAND_LINE_VALUE_REQUIRED, "[ciphers|seclevel|secrets-file|enforce]", NULL, NULL, -1,
NULL,
"TLS configuration options:"
Expand Down

0 comments on commit f1aa0df

Please sign in to comment.