Hi everyone,
Congratulations on the move to Git! I've attached four patches against
the current Git head that fix some issues for us:
1 - Fix 100% CPU usage bug. See here for explanation/solution:
http://sourceforge.net/projects/xrdp/forums/forum/389417/topic/3706601
We were hit hard by that bug, and the fix from the forum above solved it
for us.
2 - Use km-0409.ini as a fallback keymap file when the keymap requested
by the client cannot be found. This lets Windows 7 to connect to Xrdp,
since the built-in RDP client asks for keymap 20409. Others have
committed similar patches in the past; pick the best one.
3 - Force our Xvnc session to run at 96 DPI and only listen to
Localhost. We had some problems with our Linux terminal server where
Xvnc defaulted to 72 DPI, leaving the desktop subtly messed up (some
fonts were larger, some were not, etc).
4 - Friendlier error messages to end users in the login screen. We do
not want to bother our end users with too much technical detail, like
function names. Leave that to the debug log. Short, understandable
messages are key.
Cheers,
--A. Klomp
Bokxing IT, Delft, The Netherlands
>From 281510deb36083a4f3cc66442bc11c7209910f07 Mon Sep 17 00:00:00 2001
From: Alfred Klomp <alf...@bokxing.nl>
Date: Wed, 20 Oct 2010 11:53:59 +0200
Subject: [PATCH 1/4] Fix high CPU load bug
See also:
http://sourceforge.net/projects/xrdp/forums/forum/389417/topic/3706601
---
common/trans.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/common/trans.c b/common/trans.c
index 681174a..6613b46 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -214,6 +214,7 @@ trans_force_read_s(struct trans* self, struct stream* in_s,
int size)
/* error */
self->status = TRANS_STATUS_DOWN;
rv = 1;
+ break;
}
}
else if (rcvd == 0)
@@ -221,6 +222,7 @@ trans_force_read_s(struct trans* self, struct stream* in_s,
int size)
/* error */
self->status = TRANS_STATUS_DOWN;
rv = 1;
+ break;
}
else
{
@@ -271,6 +273,7 @@ trans_force_write_s(struct trans* self, struct stream*
out_s)
/* error */
self->status = TRANS_STATUS_DOWN;
rv = 1;
+ break;
}
}
else if (sent == 0)
@@ -278,6 +281,7 @@ trans_force_write_s(struct trans* self, struct stream*
out_s)
/* error */
self->status = TRANS_STATUS_DOWN;
rv = 1;
+ break;
}
else
{
--
1.6.1.3
>From 52e83916646aa552f08824bd6b02f895a7578882 Mon Sep 17 00:00:00 2001
From: Alfred Klomp <alf...@bokxing.nl>
Date: Wed, 20 Oct 2010 13:19:18 +0200
Subject: [PATCH 2/4] Use 'en-us' as fallback if keymap file not found
If the keyfile for the current keymap cannot be found, then fall
back to 0x409. We were noticing that a number of rdp clients
(Windows 7 in particular) couldn't use xrdp since they could not
get a keymap. After strace'ing xrdp, it turns out the clients were
asking for encoding 0x20409. This patch ensures that a client will
always have a fallback keymap, even if it's not the optimal one.
---
xrdp/lang.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/xrdp/lang.c b/xrdp/lang.c
index 998c6d9..0bd289c 100644
--- a/xrdp/lang.c
+++ b/xrdp/lang.c
@@ -209,6 +209,10 @@ get_keymaps(int keylayout, struct xrdp_keymap* keymap)
filename = (char*)g_malloc(256, 0);
/* check if there is a keymap file */
g_snprintf(filename, 255, "%s/km-%4.4x.ini", XRDP_CFG_PATH, keylayout);
+ /* if the file does not exist, try again with 'en-us' as fallback */
+ if (!g_file_exist(filename)) {
+ g_snprintf(filename, 255, "%s/km-0409.ini", XRDP_CFG_PATH);
+ }
if (g_file_exist(filename))
{
fd = g_file_open(filename);
--
1.6.1.3
>From f18c3cc4b4bdd0eddb9c310549badd02a190d985 Mon Sep 17 00:00:00 2001
From: Alfred Klomp <alf...@bokxing.nl>
Date: Wed, 20 Oct 2010 13:21:42 +0200
Subject: [PATCH 3/4] XVnc: force DPI to 96, listen only on localhost
Force the default dpi for xvnc to 96. We were previously getting
72 dpi, which distorted the screen (some programs had small fonts
and icons, etc). Also make our invocation of XVnc listen to
localhost exclusively.
---
sesman/sesman.ini | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/sesman/sesman.ini b/sesman/sesman.ini
index 35db5d1..640c898 100644
--- a/sesman/sesman.ini
+++ b/sesman/sesman.ini
@@ -35,3 +35,6 @@ param1=-bs
param2=-ac
param3=-nolisten
param4=tcp
+param5=-localhost
+param6=-dpi
+param7=96
--
1.6.1.3
>From 5958532604b6368a247a9fbdb8d5d52b4f365f53 Mon Sep 17 00:00:00 2001
From: Alfred Klomp <alf...@bokxing.nl>
Date: Wed, 20 Oct 2010 13:26:50 +0200
Subject: [PATCH 4/4] Friendlier on-screen messages
Do not bother end users with too much technical detail; save that
for the logs.
---
xrdp/xrdp_mm.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index f4cb6d5..56f7b9d 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -115,7 +115,8 @@ xrdp_mm_send_login(struct xrdp_mm* self)
char* name;
char* value;
- xrdp_wm_log_msg(self->wm, "sending login info to sesman");
+ xrdp_wm_log_msg(self->wm, "sending login info to session manager, "
+ "please wait...");
username = 0;
password = 0;
self->code = 0;
@@ -646,8 +647,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct
stream* s)
if (ok)
{
self->display = display;
- g_snprintf(text, 255, "xrdp_mm_process_login_response: login successful "
- "for display %d", display);
+ g_snprintf(text, 255, "login successful for display %d", display);
xrdp_wm_log_msg(self->wm, text);
if (xrdp_mm_setup_mod1(self) == 0)
{
@@ -681,13 +681,11 @@ xrdp_mm_process_login_response(struct xrdp_mm* self,
struct stream* s)
break;
}
g_sleep(1000);
- g_writeln("xrdp_mm_process_login_response: connect failed "
- "trying again...");
+ g_writeln("connect failed, trying again...");
}
if (!(self->chan_trans_up))
{
- g_writeln("xrdp_mm_process_login_response: error in trans_connect "
- "chan");
+ g_writeln("error in trans_connect chan");
}
if (self->chan_trans_up)
{
@@ -702,7 +700,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct
stream* s)
}
else
{
- xrdp_wm_log_msg(self->wm, "xrdp_mm_process_login_response: login failed");
+ xrdp_wm_log_msg(self->wm, "login failed");
}
self->delete_sesman_trans = 1;
self->connected_state = 0;
--
1.6.1.3
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
xrdp-devel mailing list
xrdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xrdp-devel