diff options
author | jsorg71 <jsorg71> | 2007-10-28 06:14:13 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2007-10-28 06:14:13 +0000 |
commit | 792caad39a2b4fadce40d17012036059d32dbb97 (patch) | |
tree | f170caba440e92d35af6920f5d4c167b7b4c96fb /libxrdp/xrdp_rdp.c | |
parent | 30492c098840916b0a99f6c95ad5516c18a081d0 (diff) | |
download | xrdp-proprietary-792caad39a2b4fadce40d17012036059d32dbb97.tar.gz xrdp-proprietary-792caad39a2b4fadce40d17012036059d32dbb97.zip |
use new config file functions
Diffstat (limited to 'libxrdp/xrdp_rdp.c')
-rw-r--r-- | libxrdp/xrdp_rdp.c | 86 |
1 files changed, 40 insertions, 46 deletions
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 742ba123..ac11ec92 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -57,70 +57,64 @@ static tui8 g_unknown2[8] = static int APP_CC xrdp_rdp_read_config(struct xrdp_client_info* client_info) { - int fd; int index; struct list* items; struct list* values; char* item; char* value; - fd = g_file_open(XRDP_CFG_FILE); /* xrdp.ini */ - if (fd > 0) + items = list_create(); + items->auto_free = 1; + values = list_create(); + values->auto_free = 1; + file_by_name_read_section(XRDP_CFG_FILE, "globals", items, values); + for (index = 0; index < items->count; index++) { - items = list_create(); - items->auto_free = 1; - values = list_create(); - values->auto_free = 1; - file_read_section(fd, "globals", items, values); - for (index = 0; index < items->count; index++) + item = (char*)list_get_item(items, index); + value = (char*)list_get_item(values, index); + if (g_strcasecmp(item, "bitmap_cache") == 0) { - item = (char*)list_get_item(items, index); - value = (char*)list_get_item(values, index); - if (g_strncasecmp(item, "bitmap_cache", 255) == 0) + if ((g_strcasecmp(value, "yes") == 0) || + (g_strcasecmp(value, "true") == 0) || + (g_strcasecmp(value, "1") == 0)) { - if (g_strncasecmp(value, "yes", 255) == 0 || - g_strncasecmp(value, "true", 255) == 0 || - g_strncasecmp(value, "1", 255) == 0) - { - client_info->use_bitmap_cache = 1; - } + client_info->use_bitmap_cache = 1; } - else if (g_strncasecmp(item, "bitmap_compression", 255) == 0) + } + else if (g_strcasecmp(item, "bitmap_compression") == 0) + { + if (g_strcasecmp(value, "yes") == 0 || + g_strcasecmp(value, "true") == 0 || + g_strcasecmp(value, "1") == 0) + { + client_info->use_bitmap_comp = 1; + } + } + else if (g_strcasecmp(item, "crypt_level") == 0) + { + if (g_strcasecmp(value, "low") == 0) + { + client_info->crypt_level = 1; + } + else if (g_strcasecmp(value, "medium") == 0) { - if (g_strncasecmp(value, "yes", 255) == 0 || - g_strncasecmp(value, "true", 255) == 0 || - g_strncasecmp(value, "1", 255) == 0) - { - client_info->use_bitmap_comp = 1; - } + client_info->crypt_level = 2; } - else if (g_strncasecmp(item, "crypt_level", 255) == 0) + else if (g_strcasecmp(value, "high") == 0) { - if (g_strncasecmp(value, "low", 255) == 0) - { - client_info->crypt_level = 1; - } - else if (g_strncasecmp(value, "medium", 255) == 0) - { - client_info->crypt_level = 2; - } - else if (g_strncasecmp(value, "high", 255) == 0) - { - client_info->crypt_level = 3; - } + client_info->crypt_level = 3; } - else if (g_strcasecmp(item, "channel_code") == 0) + } + else if (g_strcasecmp(item, "channel_code") == 0) + { + if (g_strcasecmp(value, "1") == 0) { - if (g_strcasecmp(value, "1") == 0) - { - client_info->channel_code = 1; - } + client_info->channel_code = 1; } } - list_delete(items); - list_delete(values); - g_file_close(fd); } + list_delete(items); + list_delete(values); return 0; } |