diff --git a/client/common/cmdline.c b/client/common/cmdline.c index c506eea57..0458db3d4 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -1149,10 +1149,6 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, settings->PreconnectionBlob = _strdup(arg->Value); } } - CommandLineSwitchCase(arg, "port") - { - settings->ServerPort = atoi(arg->Value); - } CommandLineSwitchCase(arg, "w") { settings->DesktopWidth = atoi(arg->Value); @@ -1755,6 +1751,13 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, } } + arg = CommandLineFindArgumentA(args, "port"); + + if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) + { + settings->ServerPort = atoi(arg->Value); + } + arg = CommandLineFindArgumentA(args, "p"); if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index b9ad028c8..fb59a73a9 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -234,6 +234,7 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->DisableEncryption = FALSE; settings->SaltedChecksum = TRUE; settings->ServerPort = 3389; + settings->GatewayPort = 443; settings->DesktopResize = TRUE; settings->ToggleFullscreen = TRUE; settings->DesktopPosX = 0; diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 567fc169e..affd27f5c 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -29,10 +29,10 @@ #include #include #include +#include #include #include -#include #include #include @@ -365,10 +365,10 @@ BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 por transport->layer = TRANSPORT_LAYER_TSG; transport->TcpOut = tcp_new(settings); - status = tcp_connect(transport->TcpIn, settings->GatewayHostname, 443); + status = tcp_connect(transport->TcpIn, settings->GatewayHostname, settings->GatewayPort); if (status) - status = tcp_connect(transport->TcpOut, settings->GatewayHostname, 443); + status = tcp_connect(transport->TcpOut, settings->GatewayHostname, settings->GatewayPort); if (status) status = transport_tsg_connect(transport, hostname, port); diff --git a/winpr/include/winpr/memory.h b/winpr/include/winpr/memory.h index 0721734a1..28e740fc4 100644 --- a/winpr/include/winpr/memory.h +++ b/winpr/include/winpr/memory.h @@ -27,6 +27,7 @@ #include #include +#include #include #include