From c548657c7b52f867c9d7598231219fd90ba7fe81 Mon Sep 17 00:00:00 2001 From: Kevin Cave Date: Sat, 18 Jan 2014 16:28:06 +0000 Subject: [PATCH 1/9] Update genkeymap.c Add a "shiftaltgr" section to the keymap generator, which should satisfy keyboard layouts such as km-0415 --- genkeymap/genkeymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/genkeymap/genkeymap.c b/genkeymap/genkeymap.c index 46513513..91ec9e89 100644 --- a/genkeymap/genkeymap.c +++ b/genkeymap/genkeymap.c @@ -45,8 +45,8 @@ int main(int argc, char **argv) char text[256]; char *displayname = NULL; char *outfname; - char *sections[5] = {"noshift", "shift", "altgr", "capslock", "shiftcapslock"}; - int states[5] = {0, 1, 0x80, 2, 3}; + char *sections[6] = {"noshift", "shift", "altgr", "shiftaltgr", "capslock", "shiftcapslock"}; + int states[6] = {0, 1, 0x80, 0x81, 2, 3}; int i; int idx; int char_count; @@ -94,7 +94,7 @@ int main(int argc, char **argv) e.display = dpy; e.same_screen = True; - for (idx = 0; idx < 5; idx++) /* Sections and states */ + for (idx = 0; idx < 6; idx++) /* Sections and states */ { fprintf(outf, "[%s]\n", sections[idx]); e.state = states[idx]; From 2aa8d672d98e4a6d4581e4977e568058a381efbd Mon Sep 17 00:00:00 2001 From: Kevin Cave Date: Sat, 18 Jan 2014 16:44:08 +0000 Subject: [PATCH 2/9] Update readme.txt --- genkeymap/readme.txt | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/genkeymap/readme.txt b/genkeymap/readme.txt index 0cfeb2e9..344fce72 100644 --- a/genkeymap/readme.txt +++ b/genkeymap/readme.txt @@ -1,35 +1,42 @@ - -crating a new keymap file. +Creating a new keymap file. +--------------------------- The names of the files are km-xxxx.ini -where the xxx is replaces ny the hex number of the layout of interest. +where the xxxx is replaced by the hex number of the layout of interest. + +The files have 6 section -The files have 5 section +[noshift], [shift], [altgr], [shiftaltgr], [capslock], [shiftcapslock] -[noshift], [shift], [altgr], [capslock], [shiftcapslock] +In each section there are multiple lines for each key. -In each section there are multiple lines for each key -An example line looks like +An example line looks like; Key10=49:49 In this line, 10 is the X11 scancode, the first 49 is the keysym value, the second 49 if the unicode value of the key. This is the definition for the 'noshift' '1' key on a en-us keyboard. In this case, the keysym -and the unicode value are the same. Here is an example where they are -not. -This is the definition for the backspace key. +and the unicode value are the same. + +Here is an example where they are not; + +This is the definition for the backspace key; Key22=65288:8 -And this is the star on the keypad +And this is the star on the keypad; Key63=65450:42 -To create a new file run xrdp-genkeymap filename +To create a new file run "xrdp-genkeymap " + +Example: ./xrdp-genkeymap /etc/xrdp/km-0409.ini -Example ./xrdp-genkeymap /etc/xrdp/km-0409.ini +Note: You need to have enough rights to be able to write to the +/etc/xrdp directory. -Note: You need to have rights to the /etc/xrdp directory. +Alternatively, create the keymap file in a directory of your choice, then +copy or move it over to /etc/xrdp using sudo/su. From a1ffd4a28e0956f6fb6dfc23b502e5cb36531d69 Mon Sep 17 00:00:00 2001 From: Kevin Cave Date: Sat, 18 Jan 2014 16:48:16 +0000 Subject: [PATCH 3/9] Update readme.txt Corrected spelling and grammar. Updated to reflect additional "shiftaltgr" section. --- genkeymap/readme.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genkeymap/readme.txt b/genkeymap/readme.txt index 344fce72..d9df684d 100644 --- a/genkeymap/readme.txt +++ b/genkeymap/readme.txt @@ -1,13 +1,13 @@ Creating a new keymap file. --------------------------- -The names of the files are +The names of the files are of the format; km-xxxx.ini where the xxxx is replaced by the hex number of the layout of interest. -The files have 6 section +The files have 6 sections; [noshift], [shift], [altgr], [shiftaltgr], [capslock], [shiftcapslock] From e7445a2544f6b4319a53f2fea71358b9a746f298 Mon Sep 17 00:00:00 2001 From: Laxmikant Rashinkar Date: Fri, 28 Feb 2014 19:28:31 -0800 Subject: [PATCH 4/9] o default login limit is now 50 users (instead of 10) o we now wait for 30 seconds for session connection (instead of 1) o if AUTO_LOGON flag is set but username is null, we force login dialog to show up --- libxrdp/xrdp_sec.c | 10 ++++++++++ sesman/sesman.ini | 2 +- xup/xup.c | 12 ++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c index ee2aa319..a4fe8c5a 100644 --- a/libxrdp/xrdp_sec.c +++ b/libxrdp/xrdp_sec.c @@ -543,6 +543,16 @@ xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s) } in_uint16_le(s, len_user); + /* + * Microsoft's itap client running on Mac OS/Android + * always sends autologon credentials, even when user has not + * configured any + */ + if (len_user == 0) + { + self->rdp_layer->client_info.rdp_autologin = 0; + } + if (len_user > 511) { DEBUG(("ERROR [xrdp_sec_process_logon_info()]: len_user > 511")); diff --git a/sesman/sesman.ini b/sesman/sesman.ini index 02fef5ba..5ee0b4cd 100644 --- a/sesman/sesman.ini +++ b/sesman/sesman.ini @@ -16,7 +16,7 @@ AlwaysGroupCheck = false [Sessions] X11DisplayOffset=10 -MaxSessions=10 +MaxSessions=50 # if 1, true, or yes, kill session after 60 seconds KillDisconnected=0 # if not zero, the seconds without mouse or keyboard input before disconnect diff --git a/xup/xup.c b/xup/xup.c index 12c570af..773f3da1 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -223,7 +223,7 @@ lib_mod_connect(struct mod *mod) g_tcp_set_no_delay(mod->sck); } - mod->server_msg(mod, "connecting...", 0); + /* mod->server_msg(mod, "connecting...", 0); */ if (use_uds) { @@ -255,7 +255,7 @@ lib_mod_connect(struct mod *mod) } else { - mod->server_msg(mod, "connect error", 0); + /* mod->server_msg(mod, "connect error", 0); */ } } @@ -268,13 +268,13 @@ lib_mod_connect(struct mod *mod) mod->sck = 0; i++; - if (i >= 4) + if (i >= 60) { mod->server_msg(mod, "connection problem, giving up", 0); break; } - g_sleep(250); + g_sleep(500); } if (error == 0) @@ -1229,7 +1229,7 @@ process_server_paint_rect_shmem_ex(struct mod *amod, struct stream *s) in_uint16_le(s, width); in_uint16_le(s, height); - + bmpdata = 0; if (flags == 0) /* screen */ { @@ -1245,7 +1245,7 @@ process_server_paint_rect_shmem_ex(struct mod *amod, struct stream *s) } if (bmpdata != 0) { - + rv = amod->server_paint_rects(amod, num_drects, ldrects, num_crects, lcrects, bmpdata, width, height, 0); From 3baa5ffa231b2cec6cc1236ada5dd8b419309d70 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 1 Mar 2014 23:20:08 -0800 Subject: [PATCH 5/9] update version --- configure.ac | 4 ++-- readme.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d4807bcc..621ce4be 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script AC_PREREQ(2.59) -AC_INIT([xrdp], [0.7.0], [xrdp-devel@lists.sourceforge.net]) +AC_INIT([xrdp], [0.9.0], [xrdp-devel@lists.sourceforge.net]) AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in) AM_INIT_AUTOMAKE([1.6 foreign]) AC_PROG_CC @@ -113,7 +113,7 @@ then [#define _FILE_OFFSET_BITS 64]) fi -# checking for libpulse +# checking for libpulse if ! test -z "$enable_loadpulsemodules" then AC_CHECK_HEADER([pulse/util.h], [], diff --git a/readme.txt b/readme.txt index e4d71703..64bf5cdf 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ -xrdp 0.7.0 +xrdp 0.9.0 Credits This project is very much dependent on FreeRDP(was rdesktop), the work of From 374633e63f35170ad25b4841a4214273560a671b Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 1 Mar 2014 23:26:40 -0800 Subject: [PATCH 6/9] common: no logic change, update comments --- common/arch.h | 2 +- common/defines.h | 2 +- common/file.c | 2 +- common/file.h | 2 +- common/file_loc.h | 2 +- common/list.c | 2 +- common/list.h | 2 +- common/log.c | 2 +- common/log.h | 2 +- common/os_calls.h | 2 +- common/parse.h | 2 +- common/rail.h | 2 +- common/thread_calls.c | 2 +- common/thread_calls.h | 2 +- common/trans.c | 2 +- common/trans.h | 2 +- common/xrdp_client_info.h | 4 ++-- common/xrdp_constants.h | 2 +- common/xrdp_rail.h | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/common/arch.h b/common/arch.h index b4eb4719..e04504f0 100644 --- a/common/arch.h +++ b/common/arch.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/defines.h b/common/defines.h index 502a41e8..c6e85a08 100644 --- a/common/defines.h +++ b/common/defines.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/file.c b/common/file.c index f1ba5a87..e21ecdb3 100644 --- a/common/file.c +++ b/common/file.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/file.h b/common/file.h index cab4304c..ec3bbcb1 100644 --- a/common/file.h +++ b/common/file.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/file_loc.h b/common/file_loc.h index c8b3a76f..36821304 100644 --- a/common/file_loc.h +++ b/common/file_loc.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/list.c b/common/list.c index 2868d767..9fde1f6f 100644 --- a/common/list.c +++ b/common/list.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/list.h b/common/list.h index f92cc843..23bc5092 100644 --- a/common/list.h +++ b/common/list.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/log.c b/common/log.c index 55353a8f..54dfaa29 100644 --- a/common/log.c +++ b/common/log.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/log.h b/common/log.h index 7a38bf38..6bb6180a 100644 --- a/common/log.h +++ b/common/log.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/os_calls.h b/common/os_calls.h index 06ce8494..3afde05c 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/parse.h b/common/parse.h index 69a57ff8..2829b70a 100644 --- a/common/parse.h +++ b/common/parse.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/rail.h b/common/rail.h index deed3a9e..26605cd9 100644 --- a/common/rail.h +++ b/common/rail.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2012 + * Copyright (C) Jay Sorg 2012-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/thread_calls.c b/common/thread_calls.c index b571fb62..a68e902a 100644 --- a/common/thread_calls.c +++ b/common/thread_calls.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/thread_calls.h b/common/thread_calls.h index 9d2c4a11..2a3122fc 100644 --- a/common/thread_calls.h +++ b/common/thread_calls.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/trans.c b/common/trans.c index aced0667..ec0b082b 100644 --- a/common/trans.c +++ b/common/trans.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/trans.h b/common/trans.h index c2e5e0df..33b57aac 100644 --- a/common/trans.h +++ b/common/trans.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h index 50c9f143..c17675e4 100644 --- a/common/xrdp_client_info.h +++ b/common/xrdp_client_info.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ struct xrdp_client_info int keyboard_type; int keyboard_subtype; - + int png_codec_id; int png_prop_len; char png_prop[64]; diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h index ed74fd01..1844a9d2 100644 --- a/common/xrdp_constants.h +++ b/common/xrdp_constants.h @@ -3,7 +3,7 @@ * Miscellaneous protocol constants * * Copyright (C) Matthew Chapman 1999-2008 - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * Copyright (C) Kevin Zhou 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/common/xrdp_rail.h b/common/xrdp_rail.h index 89cd9f95..26605cd9 100644 --- a/common/xrdp_rail.h +++ b/common/xrdp_rail.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2012-2013 + * Copyright (C) Jay Sorg 2012-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 12cbbf74e6ade3d4f528113e7b5c4d64cd95cf2f Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 2 Mar 2014 00:23:17 -0800 Subject: [PATCH 7/9] xrdp:no logic change, comments and printfs --- xrdp/funcs.c | 2 +- xrdp/lang.c | 2 +- xrdp/xrdp.c | 6 +++--- xrdp/xrdp.h | 2 +- xrdp/xrdp_bitmap.c | 2 +- xrdp/xrdp_cache.c | 2 +- xrdp/xrdp_font.c | 2 +- xrdp/xrdp_listen.c | 2 +- xrdp/xrdp_login_wnd.c | 2 +- xrdp/xrdp_mm.c | 4 ++-- xrdp/xrdp_painter.c | 14 +++++++------- xrdp/xrdp_process.c | 2 +- xrdp/xrdp_region.c | 2 +- xrdp/xrdp_types.h | 2 +- xrdp/xrdp_wm.c | 2 +- xrdp/xrdpwin.c | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/xrdp/funcs.c b/xrdp/funcs.c index cd2ccf16..add5417e 100644 --- a/xrdp/funcs.c +++ b/xrdp/funcs.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/lang.c b/xrdp/lang.c index 24dafb6a..2f2a3da5 100644 --- a/xrdp/lang.c +++ b/xrdp/lang.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 887ada68..b0fd724c 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -435,7 +435,7 @@ main(int argc, char **argv) { g_writeln(""); g_writeln("xrdp: A Remote Desktop Protocol server."); - g_writeln("Copyright (C) Jay Sorg 2004-2013"); + g_writeln("Copyright (C) Jay Sorg 2004-2014"); g_writeln("See http://xrdp.sourceforge.net for more information."); g_writeln(""); g_writeln("Usage: xrdp [options]"); @@ -453,7 +453,7 @@ main(int argc, char **argv) { g_writeln(""); g_writeln("xrdp: A Remote Desktop Protocol server."); - g_writeln("Copyright (C) Jay Sorg 2004-2013"); + g_writeln("Copyright (C) Jay Sorg 2004-2014"); g_writeln("See http://xrdp.sourceforge.net for more information."); g_writeln("Version %s", PACKAGE_VERSION); g_writeln(""); diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h index a778058f..5dc20ecd 100644 --- a/xrdp/xrdp.h +++ b/xrdp/xrdp.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index c3eef7a1..46fb6401 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c index c57fc2ad..22bbea3c 100644 --- a/xrdp/xrdp_cache.c +++ b/xrdp/xrdp_cache.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_font.c b/xrdp/xrdp_font.c index 1b7271ee..12c34d7f 100644 --- a/xrdp/xrdp_font.c +++ b/xrdp/xrdp_font.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c index 5d7edf83..38b35a47 100644 --- a/xrdp/xrdp_listen.c +++ b/xrdp/xrdp_listen.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c index 2e53fca5..cd62c013 100644 --- a/xrdp/xrdp_login_wnd.c +++ b/xrdp/xrdp_login_wnd.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 494d79d3..844cf4a5 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2164,7 +2164,7 @@ server_paint_rects(struct xrdp_mod* mod, int num_drects, short *drects, xrdp_painter_copy(p, b, wm->target_surface, s[0], s[1], s[2], s[3], s[0], s[1]); s += 4; - } + } xrdp_bitmap_delete(b); return 0; } diff --git a/xrdp/xrdp_painter.c b/xrdp/xrdp_painter.c index b9d1da16..fd583ff2 100644 --- a/xrdp/xrdp_painter.c +++ b/xrdp/xrdp_painter.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -913,19 +913,19 @@ xrdp_painter_composite(struct xrdp_painter* self, int palette_id; int cache_srcidx; int cache_mskidx; - + if (self == 0 || src == 0 || dst == 0) { return 0; } - + /* todo data */ - + if (dst->type == WND_TYPE_BITMAP) { return 0; } - + if (src->type == WND_TYPE_OFFSCREEN) { xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); @@ -933,7 +933,7 @@ xrdp_painter_composite(struct xrdp_painter* self, xrdp_region_add_rect(region, &clip_rect); dstx += dx; dsty += dy; - + palette_id = 0; cache_srcidx = src->item_index; cache_mskidx = -1; @@ -944,7 +944,7 @@ xrdp_painter_composite(struct xrdp_painter* self, cache_mskidx = msk->item_index; // todo } } - + k = 0; while (xrdp_region_get_rect(region, k, &rect1) == 0) { diff --git a/xrdp/xrdp_process.c b/xrdp/xrdp_process.c index 78576f1f..0b4a06eb 100644 --- a/xrdp/xrdp_process.c +++ b/xrdp/xrdp_process.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_region.c b/xrdp/xrdp_region.c index c66994f7..c9b6a820 100644 --- a/xrdp/xrdp_region.c +++ b/xrdp/xrdp_region.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index 7d7eb72c..b345e36c 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index ffc6d3a2..4f010698 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/xrdp/xrdpwin.c b/xrdp/xrdpwin.c index da9ba9e0..ee78273b 100644 --- a/xrdp/xrdpwin.c +++ b/xrdp/xrdpwin.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 6e093e243d7b4770e5eefa94b309ba802dffc71e Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 2 Mar 2014 00:40:45 -0800 Subject: [PATCH 8/9] update readme.txt --- readme.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 64bf5cdf..aa2b2742 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,9 @@ xrdp 0.9.0 Credits - This project is very much dependent on FreeRDP(was rdesktop), the work of - Matt Chapman and the FreeRDP team members, of which I'm a member. + This project is very much dependent on NeutrinoRDP, FreeRDP, rdesktop, and + the work of Matt Chapman and the NeutrinoRDP team members, of which I'm a + member. Mark from up 19.9 was the first to work with rdp server code. From 932d785deb501895e75e293666867fd26a3510c8 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 4 Mar 2014 18:11:55 -0800 Subject: [PATCH 9/9] fast path changes, iso never reads now --- libxrdp/libxrdp.c | 130 +++++++++++++++++++++++++++++++++++----- libxrdp/libxrdpinc.h | 4 ++ libxrdp/xrdp_fastpath.c | 2 +- libxrdp/xrdp_iso.c | 36 ++++------- libxrdp/xrdp_mcs.c | 84 ++++++++++---------------- libxrdp/xrdp_rdp.c | 5 +- libxrdp/xrdp_sec.c | 1 + xrdp/xrdp_process.c | 62 ++----------------- 8 files changed, 171 insertions(+), 153 deletions(-) diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c index 9d584244..ea1e7f25 100644 --- a/libxrdp/libxrdp.c +++ b/libxrdp/libxrdp.c @@ -62,7 +62,101 @@ libxrdp_disconnect(struct xrdp_session *session) int EXPORT_CC libxrdp_process_incomming(struct xrdp_session *session) { - return xrdp_rdp_incoming((struct xrdp_rdp *)session->rdp); + int rv; + + rv = xrdp_rdp_incoming((struct xrdp_rdp *)(session->rdp)); + return rv; +} + +/*****************************************************************************/ +int EXPORT_CC +libxrdp_get_pdu_bytes(const char *aheader) +{ + int rv; + const tui8 *header; + + rv = -1; + header = (const tui8 *) aheader; + + if (header[0] == 0x03) + { + /* TPKT */ + rv = (header[2] << 8) | header[3]; + } + else if (header[0] == 0x30) + { + /* TSRequest (NLA) */ + if (header[1] & 0x80) + { + if ((header[1] & ~(0x80)) == 1) + { + rv = header[2]; + rv += 3; + } + else if ((header[1] & ~(0x80)) == 2) + { + rv = (header[2] << 8) | header[3]; + rv += 4; + } + else + { + g_writeln("libxrdp_get_pdu_bytes: error TSRequest!"); + return -1; + } + } + else + { + rv = header[1]; + rv += 2; + } + } + else + { + /* Fast-Path */ + if (header[1] & 0x80) + { + rv = ((header[1] & 0x7F) << 8) | header[2]; + } + else + { + rv = header[1]; + } + } + return rv; +} + +/******************************************************************************/ +/* only used durring connection */ +struct stream * APP_CC +libxrdp_force_read(struct trans* trans) +{ + int bytes; + struct stream *s; + + s = trans->in_s; + init_stream(s, 32 * 1024); + if (trans_force_read(trans, 4) != 0) + { + g_writeln("libxrdp_force_read: error"); + return 0; + } + bytes = libxrdp_get_pdu_bytes(s->data); + if (bytes < 1) + { + g_writeln("libxrdp_force_read: error"); + return 0; + } + if (bytes > 32 * 1024) + { + g_writeln("libxrdp_force_read: error"); + return 0; + } + if (trans_force_read(trans, bytes - 4) != 0) + { + g_writeln("libxrdp_force_read: error"); + return 0; + } + return s; } /******************************************************************************/ @@ -74,9 +168,15 @@ libxrdp_process_data(struct xrdp_session *session, struct stream *s) int code; int term; int dead_lock_counter; + int do_read; struct xrdp_rdp *rdp; - struct stream *ls; + do_read = s == 0; + if (do_read && session->up_and_running) + { + g_writeln("libxrdp_process_data: error logic"); + return 1; + } if (session->in_process_data != 0) { g_writeln("libxrdp_process_data: error reentry"); @@ -84,14 +184,6 @@ libxrdp_process_data(struct xrdp_session *session, struct stream *s) } session->in_process_data++; - ls = 0; - if (s == 0) - { - make_stream(ls); - init_stream(ls, 8192 * 4); - s = ls; - } - term = 0; cont = 1; rv = 0; @@ -106,13 +198,26 @@ libxrdp_process_data(struct xrdp_session *session, struct stream *s) if (session->is_term()) { term = 1; + break; } } code = 0; + if (do_read) + { + s = libxrdp_force_read(session->trans); + if (s == 0) + { + g_writeln("libxrdp_process_data: libxrdp_force_read failed"); + rv = 1; + break; + } + } + if (xrdp_rdp_recv(rdp, s, &code) != 0) { + g_writeln("libxrdp_process_data: xrdp_rdp_recv failed"); rv = 1; break; } @@ -181,11 +286,6 @@ libxrdp_process_data(struct xrdp_session *session, struct stream *s) } } - if (s == ls) - { - free_stream(s); - } - session->in_process_data--; return rv; diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h index d322eafa..58ba5093 100644 --- a/libxrdp/libxrdpinc.h +++ b/libxrdp/libxrdpinc.h @@ -82,6 +82,10 @@ int DEFAULT_CC libxrdp_disconnect(struct xrdp_session* session); int DEFAULT_CC libxrdp_process_incomming(struct xrdp_session* session); +int EXPORT_CC +libxrdp_get_pdu_bytes(const char *aheader); +struct stream * APP_CC +libxrdp_force_read(struct trans* trans); int DEFAULT_CC libxrdp_process_data(struct xrdp_session* session, struct stream *s); int DEFAULT_CC diff --git a/libxrdp/xrdp_fastpath.c b/libxrdp/xrdp_fastpath.c index 572b5a98..5f7ccc97 100644 --- a/libxrdp/xrdp_fastpath.c +++ b/libxrdp/xrdp_fastpath.c @@ -63,7 +63,7 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s) DEBUG((" in xrdp_fastpath_recv")); in_uint8(s, fp_hdr); /* fpInputHeader (1 byte) */ - g_writeln("xrdp_fastpath_recv: header= 0x%8.8x", fp_hdr); + //g_writeln("xrdp_fastpath_recv: header= 0x%8.8x", fp_hdr); self->numEvents = (fp_hdr & 0x3C) >> 2; self->secFlags = (fp_hdr & 0xC0) >> 6; diff --git a/libxrdp/xrdp_iso.c b/libxrdp/xrdp_iso.c index 31c279b5..0ea07c18 100644 --- a/libxrdp/xrdp_iso.c +++ b/libxrdp/xrdp_iso.c @@ -90,27 +90,21 @@ xrdp_iso_recv_msg(struct xrdp_iso *self, struct stream *s, int *code, int *len) { int ver; // TPKT Version int plen; // TPKT PacketLength - int do_read; *code = 0; // X.224 Packet Type *len = 0; // X.224 Length Indicator - /* early in connection sequence, iso needs to do a force read */ - do_read = s != self->trans->in_s; - - if (do_read) + if (s != self->trans->in_s) { - init_stream(s, 4); - if (trans_force_read_s(self->trans, s, 4) != 0) - { - return 1; - } + g_writeln("xrdp_iso_recv_msg error logic"); } in_uint8(s, ver); if (ver != 3) { + g_writeln("xrdp_iso_recv_msg: bad ver"); + g_hexdump(s->data, 4); return 1; } @@ -122,15 +116,6 @@ xrdp_iso_recv_msg(struct xrdp_iso *self, struct stream *s, int *code, int *len) return 1; } - if (do_read) - { - init_stream(s, plen - 4); - if (trans_force_read_s(self->trans, s, plen - 4) != 0) - { - return 1; - } - } - if (!s_check_rem(s, 2)) { return 1; @@ -311,20 +296,22 @@ xrdp_iso_incoming(struct xrdp_iso *self) char *pend; struct stream *s; - make_stream(s); - init_stream(s, 8192); DEBUG((" in xrdp_iso_incoming")); + s = libxrdp_force_read(self->trans); + if (s == 0) + { + return 1; + } + if (xrdp_iso_recv_msg(self, s, &code, &len) != 0) { DEBUG((" in xrdp_iso_recv_msg error!!")); - free_stream(s); return 1; } if ((code != ISO_PDU_CR) || (len < 6)) { - free_stream(s); return 1; } @@ -343,7 +330,6 @@ xrdp_iso_incoming(struct xrdp_iso *self) case RDP_NEG_REQ: /* rdpNegReq 1 */ if (xrdp_iso_recv_rdpnegreq(self, s) != 0) { - free_stream(s); return 1; } break; @@ -371,12 +357,10 @@ xrdp_iso_incoming(struct xrdp_iso *self) if (xrdp_iso_send_nego(self) != 0) { - free_stream(s); return 1; } DEBUG((" out xrdp_iso_incoming")); - free_stream(s); return 0; } diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c index 08055191..a9e8d7b5 100644 --- a/libxrdp/xrdp_mcs.c +++ b/libxrdp/xrdp_mcs.c @@ -129,6 +129,7 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) if (xrdp_iso_recv(self->iso_layer, s) != 0) { DEBUG((" out xrdp_mcs_recv, xrdp_iso_recv return non zero")); + g_writeln("xrdp_mcs_recv: xrdp_iso_recv failed"); return 1; } @@ -150,12 +151,7 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) /* this is channels getting added from the client */ if (appid == MCS_CJRQ) { - if (s == self->iso_layer->trans->in_s) - { - /* this should not happen */ - g_writeln("xrdp_mcs_recv: error, MCS_CJRQ at wrong time"); - return 1; - } + if (!s_check_rem(s, 4)) { return 1; @@ -170,6 +166,14 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) { log_message(LOG_LEVEL_ERROR,"Non handled error from xrdp_mcs_send_cjcf") ; } + + s = libxrdp_force_read(self->iso_layer->trans); + if (s == 0) + { + g_writeln("xrdp_mcs_recv: libxrdp_force_read failed"); + return 1; + } + continue; } @@ -321,30 +325,29 @@ xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self) int len; struct stream *s; - make_stream(s); - init_stream(s, 16 * 1024); + s = libxrdp_force_read(self->iso_layer->trans); + if (s == 0) + { + return 1; + } if (xrdp_iso_recv(self->iso_layer, s) != 0) { - free_stream(s); return 1; } if (xrdp_mcs_ber_parse_header(self, s, MCS_CONNECT_INITIAL, &len) != 0) { - free_stream(s); return 1; } if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { - free_stream(s); return 1; } if ((len < 0) || !s_check_rem(s, len)) { - free_stream(s); return 1; } @@ -352,13 +355,11 @@ xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self) if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { - free_stream(s); return 1; } if ((len < 0) || !s_check_rem(s, len)) { - free_stream(s); return 1; } @@ -366,13 +367,11 @@ xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self) if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_BOOLEAN, &len) != 0) { - free_stream(s); return 1; } if ((len < 0) || !s_check_rem(s, len)) { - free_stream(s); return 1; } @@ -380,38 +379,32 @@ xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self) if (xrdp_mcs_parse_domain_params(self, s) != 0) { - free_stream(s); return 1; } if (xrdp_mcs_parse_domain_params(self, s) != 0) { - free_stream(s); return 1; } if (xrdp_mcs_parse_domain_params(self, s) != 0) { - free_stream(s); return 1; } if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { - free_stream(s); return 1; } /* mcs data can not be zero length */ if ((len <= 0) || (len > 16 * 1024)) { - free_stream(s); return 1; } if (!s_check_rem(s, len)) { - free_stream(s); return 1; } @@ -423,12 +416,10 @@ xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self) if (s_check_end(s)) { - free_stream(s); return 0; } else { - free_stream(s); return 1; } } @@ -442,18 +433,20 @@ xrdp_mcs_recv_edrq(struct xrdp_mcs *self) struct stream *s; DEBUG((" in xrdp_mcs_recv_edrq")); - make_stream(s); - init_stream(s, 8192); + + s = libxrdp_force_read(self->iso_layer->trans); + if (s == 0) + { + return 1; + } if (xrdp_iso_recv(self->iso_layer, s) != 0) { - free_stream(s); return 1; } - + if (!s_check_rem(s, 1)) { - free_stream(s); return 1; } @@ -461,13 +454,11 @@ xrdp_mcs_recv_edrq(struct xrdp_mcs *self) if ((opcode >> 2) != MCS_EDRQ) { - free_stream(s); return 1; } if (!s_check_rem(s, 4)) { - free_stream(s); return 1; } @@ -478,7 +469,6 @@ xrdp_mcs_recv_edrq(struct xrdp_mcs *self) { if (!s_check_rem(s, 2)) { - free_stream(s); return 1; } in_uint16_be(s, self->userid); @@ -486,11 +476,9 @@ xrdp_mcs_recv_edrq(struct xrdp_mcs *self) if (!(s_check_end(s))) { - free_stream(s); return 1; } - free_stream(s); DEBUG((" out xrdp_mcs_recv_edrq")); return 0; } @@ -504,18 +492,20 @@ xrdp_mcs_recv_aurq(struct xrdp_mcs *self) struct stream *s; DEBUG((" in xrdp_mcs_recv_aurq")); - make_stream(s); - init_stream(s, 8192); + + s = libxrdp_force_read(self->iso_layer->trans); + if (s == 0) + { + return 1; + } if (xrdp_iso_recv(self->iso_layer, s) != 0) { - free_stream(s); return 1; } if (!s_check_rem(s, 1)) { - free_stream(s); return 1; } @@ -523,7 +513,6 @@ xrdp_mcs_recv_aurq(struct xrdp_mcs *self) if ((opcode >> 2) != MCS_AURQ) { - free_stream(s); return 1; } @@ -531,7 +520,6 @@ xrdp_mcs_recv_aurq(struct xrdp_mcs *self) { if (!s_check_rem(s, 2)) { - free_stream(s); return 1; } in_uint16_be(s, self->userid); @@ -539,11 +527,9 @@ xrdp_mcs_recv_aurq(struct xrdp_mcs *self) if (!(s_check_end(s))) { - free_stream(s); return 1; } - free_stream(s); DEBUG((" out xrdp_mcs_recv_aurq")); return 0; } @@ -591,18 +577,19 @@ xrdp_mcs_recv_cjrq(struct xrdp_mcs *self) int opcode; struct stream *s; - make_stream(s); - init_stream(s, 8192); + s = libxrdp_force_read(self->iso_layer->trans); + if (s == 0) + { + return 1; + } if (xrdp_iso_recv(self->iso_layer, s) != 0) { - free_stream(s); return 1; } if (!s_check_rem(s, 1)) { - free_stream(s); return 1; } @@ -610,13 +597,11 @@ xrdp_mcs_recv_cjrq(struct xrdp_mcs *self) if ((opcode >> 2) != MCS_CJRQ) { - free_stream(s); return 1; } if (!s_check_rem(s, 4)) { - free_stream(s); return 1; } @@ -626,7 +611,6 @@ xrdp_mcs_recv_cjrq(struct xrdp_mcs *self) { if (!s_check_rem(s, 2)) { - free_stream(s); return 1; } in_uint8s(s, 2); @@ -634,11 +618,9 @@ xrdp_mcs_recv_cjrq(struct xrdp_mcs *self) if (!(s_check_end(s))) { - free_stream(s); return 1; } - free_stream(s); return 0; } diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 787b6e6c..729a2f29 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -299,17 +299,17 @@ xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code) int pdu_code = 0; int chan = 0; const tui8 *header; - header = (const tui8 *) (self->session->trans->in_s->p); DEBUG(("in xrdp_rdp_recv")); if (s->next_packet == 0 || s->next_packet >= s->end) { /* check for fastpath first */ + header = (const tui8 *) (self->session->trans->in_s->p); if ((header[0] != 0x3) && (header[0] != 0x3c)) { if (xrdp_sec_recv_fastpath(self->sec_layer, s) != 0) { - return 1; + return 1; } *code = 2; // special code for fastpath input DEBUG(("out (fastpath) xrdp_rdp_recv")); @@ -331,6 +331,7 @@ xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code) if (error != 0) { DEBUG(("out xrdp_rdp_recv error")); + g_writeln("xrdp_rdp_recv: xrdp_sec_recv failed"); return 1; } diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c index d0f84273..c99f9188 100644 --- a/libxrdp/xrdp_sec.c +++ b/libxrdp/xrdp_sec.c @@ -996,6 +996,7 @@ xrdp_sec_recv(struct xrdp_sec *self, struct stream *s, int *chan) if (xrdp_mcs_recv(self->mcs_layer, s, chan) != 0) { DEBUG((" out xrdp_sec_recv : error")); + g_writeln("xrdp_sec_recv: xrdp_mcs_recv failed"); return 1; } diff --git a/xrdp/xrdp_process.c b/xrdp/xrdp_process.c index ab4808b0..c60c40dc 100644 --- a/xrdp/xrdp_process.c +++ b/xrdp/xrdp_process.c @@ -114,63 +114,6 @@ xrdp_process_mod_end(struct xrdp_process *self) return 0; } -/*****************************************************************************/ -static int APP_CC -xrdp_process_get_pdu_bytes(const char *aheader) -{ - int rv; - const tui8 *header; - - rv = -1; - header = (const tui8 *) aheader; - - if (header[0] == 0x03) - { - /* TPKT */ - rv = (header[2] << 8) | header[3]; - } - else if (header[0] == 0x30) - { - /* TSRequest (NLA) */ - if (header[1] & 0x80) - { - if ((header[1] & ~(0x80)) == 1) - { - rv = header[2]; - rv += 3; - } - else if ((header[1] & ~(0x80)) == 2) - { - rv = (header[2] << 8) | header[3]; - rv += 4; - } - else - { - g_writeln("xrdp_process_get_packet_bytes: error TSRequest!"); - return -1; - } - } - else - { - rv = header[1]; - rv += 2; - } - } - else - { - /* Fast-Path */ - if (header[1] & 0x80) - { - rv = ((header[1] & 0x7F) << 8) | header[2]; - } - else - { - rv = header[1]; - } - } - return rv; -} - /*****************************************************************************/ static int DEFAULT_CC xrdp_process_data_in(struct trans *self) @@ -197,12 +140,13 @@ xrdp_process_data_in(struct trans *self) { pro->server_trans->extra_flags = 1; pro->server_trans->header_size = 4; + init_stream(s, 0); } break; case 1: /* we have enough now to get the PDU bytes */ - len = xrdp_process_get_pdu_bytes(s->p); + len = libxrdp_get_pdu_bytes(s->p); if (len == -1) { g_writeln("xrdp_process_data_in: " @@ -259,6 +203,8 @@ xrdp_process_main_loop(struct xrdp_process *self) if (libxrdp_process_incomming(self->session) == 0) { + init_stream(self->server_trans->in_s, 32 * 1024); + term_obj = g_get_term_event(); cont = 1;