libfreerdp-core: fix ignored port settings for TS Gateway and vmconnect

This commit is contained in:
Marc-André Moreau 2014-02-05 11:54:42 -05:00
parent 1ce1bcb5a3
commit e8a9b7ff14
4 changed files with 12 additions and 7 deletions

View File

@ -1149,10 +1149,6 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
settings->PreconnectionBlob = _strdup(arg->Value); settings->PreconnectionBlob = _strdup(arg->Value);
} }
} }
CommandLineSwitchCase(arg, "port")
{
settings->ServerPort = atoi(arg->Value);
}
CommandLineSwitchCase(arg, "w") CommandLineSwitchCase(arg, "w")
{ {
settings->DesktopWidth = atoi(arg->Value); 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"); arg = CommandLineFindArgumentA(args, "p");
if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)

View File

@ -234,6 +234,7 @@ rdpSettings* freerdp_settings_new(DWORD flags)
settings->DisableEncryption = FALSE; settings->DisableEncryption = FALSE;
settings->SaltedChecksum = TRUE; settings->SaltedChecksum = TRUE;
settings->ServerPort = 3389; settings->ServerPort = 3389;
settings->GatewayPort = 443;
settings->DesktopResize = TRUE; settings->DesktopResize = TRUE;
settings->ToggleFullscreen = TRUE; settings->ToggleFullscreen = TRUE;
settings->DesktopPosX = 0; settings->DesktopPosX = 0;

View File

@ -29,10 +29,10 @@
#include <winpr/crt.h> #include <winpr/crt.h>
#include <winpr/synch.h> #include <winpr/synch.h>
#include <winpr/print.h> #include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/error.h> #include <freerdp/error.h>
#include <freerdp/utils/tcp.h> #include <freerdp/utils/tcp.h>
#include <winpr/stream.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
@ -365,10 +365,10 @@ BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 por
transport->layer = TRANSPORT_LAYER_TSG; transport->layer = TRANSPORT_LAYER_TSG;
transport->TcpOut = tcp_new(settings); transport->TcpOut = tcp_new(settings);
status = tcp_connect(transport->TcpIn, settings->GatewayHostname, 443); status = tcp_connect(transport->TcpIn, settings->GatewayHostname, settings->GatewayPort);
if (status) if (status)
status = tcp_connect(transport->TcpOut, settings->GatewayHostname, 443); status = tcp_connect(transport->TcpOut, settings->GatewayHostname, settings->GatewayPort);
if (status) if (status)
status = transport_tsg_connect(transport, hostname, port); status = transport_tsg_connect(transport, hostname, port);

View File

@ -27,6 +27,7 @@
#include <winpr/winpr.h> #include <winpr/winpr.h>
#include <winpr/wtypes.h> #include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/file.h> #include <winpr/file.h>
#include <winpr/heap.h> #include <winpr/heap.h>