Fixed warning messages for RDP file options
networkautodetect and bandwidthautodetect are both boolean options
which must match each other. Added adequate warnings.
@@ -1614,12 +1614,23 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
{
if (file->BandwidthAutoDetect != 0)
{
+ if ((~file->NetworkAutoDetect) && (file->NetworkAutoDetect != 0))
+ {
+ WLog_WARN(TAG,
+ "Got networkautodetect:i:%" PRIu32 " and bandwidthautodetect:i:%" PRIu32
+ ". Correcting to networkautodetect:i:0",
+ file->NetworkAutoDetect, file->BandwidthAutoDetect);
+ WLog_WARN(TAG,
+ "Add networkautodetect:i:0 to your RDP file to eliminate this warning.");
+ }
+
if (!freerdp_set_connection_type(settings, CONNECTION_TYPE_AUTODETECT))
return FALSE;
setDefaultConnectionType = FALSE;
}
if (!freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect,
- file->BandwidthAutoDetect != 0))
+ (file->BandwidthAutoDetect != 0) ||
+ (file->NetworkAutoDetect == 0)))
return FALSE;
}
@@ -1627,25 +1638,24 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings*
{
if (file->NetworkAutoDetect == 0)
{
- if (file->BandwidthAutoDetect != CONNECTION_TYPE_AUTODETECT)
+ if ((~file->BandwidthAutoDetect) && (file->BandwidthAutoDetect == 0))
{
WLog_WARN(TAG,
"Got networkautodetect:i:%" PRIu32 " and bandwidthautodetect:i:%" PRIu32
- ". Correcting to bandwidthautodetect:i:%" PRIu32,
- file->NetworkAutoDetect, file->BandwidthAutoDetect,
- CONNECTION_TYPE_AUTODETECT);
- WLog_WARN(TAG,
- "Add bandwidthautodetect:i:%" PRIu32
- " to your RDP file to eliminate this warning.",
- CONNECTION_TYPE_AUTODETECT);
+ ". Correcting to bandwidthautodetect:i:1",
+ file->NetworkAutoDetect, file->BandwidthAutoDetect);
+ WLog_WARN(
+ TAG, "Add bandwidthautodetect:i:1 to your RDP file to eliminate this warning.");
}
if (!freerdp_set_connection_type(settings, CONNECTION_TYPE_AUTODETECT))
return FALSE;
+
setDefaultConnectionType = FALSE;
}
if (!freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect,
- file->NetworkAutoDetect == 0))
+ (file->BandwidthAutoDetect != 0) ||
+ (file->NetworkAutoDetect == 0)))
return FALSE;
}
