From 12ce9c136fd577023e77e3bd51e6f25a051ca3a1 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Wed, 24 Aug 2011 22:45:02 -0700 Subject: [PATCH] add max bpp option to xrdp.ini --- libxrdp/libxrdpinc.h | 1 + libxrdp/xrdp_rdp.c | 11 +++++++++++ xrdp/xrdp.ini | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h index a32fdce5..8d00fe11 100644 --- a/libxrdp/libxrdpinc.h +++ b/libxrdp/libxrdpinc.h @@ -64,6 +64,7 @@ struct xrdp_client_info int brush_cache_code; /* 0 = no cache 1 = 8x8 standard cache 2 = arbitrary dimensions */ char client_ip[256]; + int max_bpp; }; struct xrdp_brush diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index fa833765..78d0762c 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -117,6 +117,10 @@ xrdp_rdp_read_config(struct xrdp_client_info* client_info) client_info->channel_code = 1; } } + else if (g_strcasecmp(item, "max_bpp") == 0) + { + client_info->max_bpp = g_atoi(value); + } } list_delete(items); list_delete(values); @@ -362,6 +366,13 @@ xrdp_rdp_parse_client_mcs_data(struct xrdp_rdp* self) self->client_info.bpp = 24; break; } + if (self->client_info.max_bpp > 0) + { + if (self->client_info.bpp > self->client_info.max_bpp) + { + self->client_info.bpp = self->client_info.max_bpp; + } + } p->p = p->data; DEBUG(("client width %d, client height %d bpp %d", self->client_info.width, self->client_info.height, diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini index e5e6e3d9..645ee024 100644 --- a/xrdp/xrdp.ini +++ b/xrdp/xrdp.ini @@ -5,6 +5,7 @@ bitmap_compression=yes port=3389 crypt_level=low channel_code=1 +max_bpp=16 #black=000000 #grey=d6d3ce #dark_grey=808080 @@ -15,7 +16,6 @@ channel_code=1 #green=00ff00 #background=626c72 - [xrdp1] name=sesman-Xvnc lib=libvnc.so