Merge branch 'master' of git://github.com/awakecoding/FreeRDP

# By Marc-André Moreau
# Via Marc-André Moreau
* 'master' of git://github.com/awakecoding/FreeRDP:
  freerdp: separate GatewayUsageMethod from GatewayEnabled
This commit is contained in:
Benoît LeBlanc 2013-07-03 15:07:35 -04:00
commit ea4ad89f09
9 changed files with 41 additions and 20 deletions

View File

@ -686,7 +686,8 @@ JNIEXPORT void JNICALL jni_freerdp_set_gateway_info(JNIEnv *env, jclass cls, jin
settings->GatewayUsername = strdup(gatewayusername);
settings->GatewayPassword = strdup(gatewaypassword);
settings->GatewayDomain = strdup(gatewaydomain);
settings->GatewayUsageMethod = TRUE;
settings->GatewayUsageMethod = TSC_PROXY_MODE_DIRECT;
settings->GatewayEnabled = TRUE;
settings->GatewayUseSameCredentials = FALSE;
(*env)->ReleaseStringUTFChars(env, jgatewayhostname, gatewayhostname);

View File

@ -1243,8 +1243,9 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
settings->GatewayHostname = _strdup(settings->ServerHostname);
}
settings->GatewayUsageMethod = TRUE;
settings->GatewayUsageMethod = TSC_PROXY_MODE_DIRECT;
settings->GatewayUseSameCredentials = TRUE;
settings->GatewayEnabled = TRUE;
}
CommandLineSwitchCase(arg, "gu")
{
@ -1638,7 +1639,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
if (settings->DisableThemes)
settings->PerformanceFlags |= PERF_DISABLE_THEMING;
if (settings->GatewayUsageMethod)
if (settings->GatewayEnabled)
{
if (settings->GatewayUseSameCredentials)
{

View File

@ -731,11 +731,19 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
if (~((size_t) file->GatewayHostname))
freerdp_set_param_string(settings, FreeRDP_GatewayHostname, file->GatewayHostname);
if (~file->GatewayUsageMethod)
freerdp_set_param_bool(settings, FreeRDP_GatewayUsageMethod, file->GatewayUsageMethod);
{
freerdp_set_param_uint32(settings, FreeRDP_GatewayUsageMethod, file->GatewayUsageMethod);
if (file->GatewayUsageMethod == TSC_PROXY_MODE_DIRECT)
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
else if (file->GatewayUsageMethod == TSC_PROXY_MODE_NONE_DETECT)
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
}
if (~file->PromptCredentialOnce)
freerdp_set_param_bool(settings, FreeRDP_GatewayUsageMethod, file->GatewayUsageMethod);
settings->GatewayUseSameCredentials = TRUE;
freerdp_set_param_bool(settings, FreeRDP_GatewayUseSameCredentials, TRUE);
if (~file->RemoteApplicationMode)
freerdp_set_param_bool(settings, FreeRDP_RemoteApplicationMode, file->RemoteApplicationMode);

View File

@ -175,7 +175,8 @@ NSString* TSXSessionDidFailToConnectNotification = @"TSXSessionDidFailToConnect"
settings->GatewayUsername = strdup([_params UTF8StringForKey:@"tsg_username"]);
settings->GatewayPassword = strdup([_params UTF8StringForKey:@"tsg_password"]);
settings->GatewayDomain = strdup([_params UTF8StringForKey:@"tsg_domain"]);
settings->GatewayUsageMethod = TRUE;
settings->GatewayUsageMethod = TSC_PROXY_MODE_DIRECT;
settings->GatewayEnabled = TRUE;
settings->GatewayUseSameCredentials = FALSE;
}

View File

@ -633,6 +633,7 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL;
#define FreeRDP_GatewayDomain 1989
#define FreeRDP_GatewayCredentialsSource 1990
#define FreeRDP_GatewayUseSameCredentials 1991
#define FreeRDP_GatewayEnabled 1992
#define FreeRDP_RemoteApplicationMode 2112
#define FreeRDP_RemoteApplicationName 2113
#define FreeRDP_RemoteApplicationIcon 2114
@ -1019,7 +1020,7 @@ struct rdp_settings
*/
/* Gateway */
ALIGN64 BOOL GatewayUsageMethod; /* 1984 */
ALIGN64 UINT32 GatewayUsageMethod; /* 1984 */
ALIGN64 UINT32 GatewayPort; /* 1985 */
ALIGN64 char* GatewayHostname; /* 1986 */
ALIGN64 char* GatewayUsername; /* 1987 */
@ -1027,7 +1028,8 @@ struct rdp_settings
ALIGN64 char* GatewayDomain; /* 1989 */
ALIGN64 UINT32 GatewayCredentialsSource; /* 1990 */
ALIGN64 BOOL GatewayUseSameCredentials; /* 1991 */
UINT64 padding2048[2048 - 1992]; /* 1992 */
ALIGN64 BOOL GatewayEnabled; /* 1992 */
UINT64 padding2048[2048 - 1993]; /* 1993 */
UINT64 padding2112[2112 - 2048]; /* 2048 */
/**

View File

@ -562,14 +562,14 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id)
return settings->PlayRemoteFx;
break;
case FreeRDP_GatewayUsageMethod:
return settings->GatewayUsageMethod;
break;
case FreeRDP_GatewayUseSameCredentials:
return settings->GatewayUseSameCredentials;
break;
case FreeRDP_GatewayEnabled:
return settings->GatewayEnabled;
break;
case FreeRDP_RemoteApplicationMode:
return settings->RemoteApplicationMode;
break;
@ -1017,14 +1017,14 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)
settings->PlayRemoteFx = param;
break;
case FreeRDP_GatewayUsageMethod:
settings->GatewayUsageMethod = param;
break;
case FreeRDP_GatewayUseSameCredentials:
settings->GatewayUseSameCredentials = param;
break;
case FreeRDP_GatewayEnabled:
settings->GatewayEnabled = param;
break;
case FreeRDP_RemoteApplicationMode:
settings->RemoteApplicationMode = param;
break;
@ -1417,6 +1417,10 @@ UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id)
return settings->PercentScreen;
break;
case FreeRDP_GatewayUsageMethod:
return settings->GatewayUsageMethod;
break;
case FreeRDP_GatewayPort:
return settings->GatewayPort;
break;
@ -1736,6 +1740,10 @@ int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param)
settings->PercentScreen = param;
break;
case FreeRDP_GatewayUsageMethod:
settings->GatewayUsageMethod = param;
break;
case FreeRDP_GatewayPort:
settings->GatewayPort = param;
break;

View File

@ -75,7 +75,7 @@ BOOL rdp_client_connect(rdpRdp* rdp)
nego_init(rdp->nego);
nego_set_target(rdp->nego, settings->ServerHostname, settings->ServerPort);
if (settings->GatewayUsageMethod)
if (settings->GatewayEnabled)
{
char* user;
char* domain;

View File

@ -212,7 +212,7 @@ BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 por
(LPTHREAD_START_ROUTINE) transport_client_thread, transport, 0, NULL);
}
if (transport->settings->GatewayUsageMethod)
if (transport->settings->GatewayEnabled)
{
transport->layer = TRANSPORT_LAYER_TSG;
transport->TcpOut = tcp_new(settings);

View File

@ -184,7 +184,7 @@ BOOL tls_connect(rdpTls* tls)
return FALSE;
}
if (tls->settings->GatewayUsageMethod)
if (tls->settings->GatewayEnabled)
hostname = tls->settings->GatewayHostname;
else
hostname = tls->settings->ServerHostname;