diff options
Diffstat (limited to 'xrdp')
| -rw-r--r-- | xrdp/xrdp.c | 2 | ||||
| -rw-r--r-- | xrdp/xrdp.h | 4 | ||||
| -rw-r--r-- | xrdp/xrdp.ini | 4 | ||||
| -rw-r--r-- | xrdp/xrdp_bitmap.c | 57 | ||||
| -rw-r--r-- | xrdp/xrdp_cache.c | 30 | ||||
| -rw-r--r-- | xrdp/xrdp_listen.c | 10 | ||||
| -rw-r--r-- | xrdp/xrdp_mm.c | 7 | ||||
| -rw-r--r-- | xrdp/xrdp_process.c | 3 | ||||
| -rw-r--r-- | xrdp/xrdp_types.h | 3 | ||||
| -rw-r--r-- | xrdp/xrdp_wm.c | 2 |
10 files changed, 98 insertions, 24 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 0c340e55..887ada68 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -138,7 +138,7 @@ xrdp_child_fork(void) } /*****************************************************************************/ -int APP_CC +int DEFAULT_CC g_is_term(void) { return g_is_wait_obj_set(g_term_event); diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h index 4215c27b..172d417a 100644 --- a/xrdp/xrdp.h +++ b/xrdp/xrdp.h @@ -27,8 +27,8 @@ #include "trans.h" #include "list.h" #include "libxrdpinc.h" -#include "xrdp_types.h" #include "xrdp_constants.h" +#include "xrdp_types.h" #include "defines.h" #include "os_calls.h" #include "ssl_calls.h" @@ -41,7 +41,7 @@ long APP_CC g_xrdp_sync(long (*sync_func)(long param1, long param2), long sync_param1, long sync_param2); -int APP_CC +int DEFAULT_CC g_is_term(void); void APP_CC g_set_term(int in_val); diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini index 8d97c0d3..c191619b 100644 --- a/xrdp/xrdp.ini +++ b/xrdp/xrdp.ini @@ -112,8 +112,8 @@ ip=ask port=ask3389 [xrdp7] -name=freerdp-any -lib=libxrdpfreerdp1.so +name=neutrinordp-any +lib=libxrdpneutrinordp.so ip=ask port=ask3389 username=ask diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 19620c40..b3faea41 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -821,6 +821,8 @@ xrdp_bitmap_copy_box_with_crc(struct xrdp_bitmap *self, unsigned char *d8 = (unsigned char *)NULL; unsigned short *s16 = (unsigned short *)NULL; unsigned short *d16 = (unsigned short *)NULL; + unsigned int *s32; + unsigned int *d32; if (self == 0) { @@ -864,16 +866,65 @@ xrdp_bitmap_copy_box_with_crc(struct xrdp_bitmap *self, if (self->bpp == 24) { + s32 = ((unsigned int *)(self->data)) + (self->width * y + x); + d32 = ((unsigned int *)(dest->data)) + (dest->width * desty + destx); + incs = self->width - cx; + incd = dest->width - cx; + for (i = 0; i < cy; i++) { - for (j = 0; j < cx; j++) + j = 0; + while (j < cx - 4) { - pixel = GETPIXEL32(self->data, j + x, i + y, self->width); + pixel = *s32; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); - SETPIXEL32(dest->data, j + destx, i + desty, dest->width, pixel); + *d32 = pixel; + s32++; + d32++; + + pixel = *s32; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + *d32 = pixel; + s32++; + d32++; + + pixel = *s32; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + *d32 = pixel; + s32++; + d32++; + + pixel = *s32; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + *d32 = pixel; + s32++; + d32++; + + j += 4; } + while (j < cx) + { + pixel = *s32; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + *d32 = pixel; + s32++; + d32++; + + j += 1; + } + + s32 += incs; + d32 += incd; } } else if (self->bpp == 15 || self->bpp == 16) diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c index 16ce1283..a93f73c4 100644 --- a/xrdp/xrdp_cache.c +++ b/xrdp/xrdp_cache.c @@ -45,12 +45,22 @@ xrdp_cache_create(struct xrdp_wm *owner, self->wm = owner; self->session = session; self->use_bitmap_comp = client_info->use_bitmap_comp; - self->cache1_entries = client_info->cache1_entries; + + self->cache1_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX, + client_info->cache1_entries); + self->cache1_entries = MAX(self->cache1_entries, 0); self->cache1_size = client_info->cache1_size; - self->cache2_entries = client_info->cache2_entries; + + self->cache2_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX, + client_info->cache2_entries); + self->cache2_entries = MAX(self->cache2_entries, 0); self->cache2_size = client_info->cache2_size; - self->cache3_entries = client_info->cache3_entries; + + self->cache3_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX, + client_info->cache3_entries); + self->cache3_entries = MAX(self->cache3_entries, 0); self->cache3_size = client_info->cache3_size; + self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable; self->bitmap_cache_version = client_info->bitmap_cache_version; self->pointer_cache_entries = client_info->pointer_cache_entries; @@ -150,6 +160,11 @@ xrdp_cache_reset(struct xrdp_cache *self, return 0; } +#define COMPARE_WITH_CRC(_b1, _b2) \ + ((_b1 != 0) && (_b2 != 0) && (_b1->crc == _b2->crc) && \ + (_b1->bpp == _b2->bpp) && \ + (_b1->width == _b2->width) && (_b1->height == _b2->height)) + /*****************************************************************************/ /* returns cache id */ int APP_CC @@ -184,8 +199,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, for (j = 0; j < self->cache1_entries; j++) { #ifdef USE_CRC - - if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + if (COMPARE_WITH_CRC(self->bitmap_items[i][j].bitmap, bitmap)) #else if (xrdp_bitmap_compare(self->bitmap_items[i][j].bitmap, bitmap)) #endif @@ -204,8 +218,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, for (j = 0; j < self->cache2_entries; j++) { #ifdef USE_CRC - - if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + if (COMPARE_WITH_CRC(self->bitmap_items[i][j].bitmap, bitmap)) #else if (xrdp_bitmap_compare(self->bitmap_items[i][j].bitmap, bitmap)) #endif @@ -224,8 +237,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, for (j = 0; j < self->cache3_entries; j++) { #ifdef USE_CRC - - if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + if (COMPARE_WITH_CRC(self->bitmap_items[i][j].bitmap, bitmap)) #else if (xrdp_bitmap_compare(self->bitmap_items[i][j].bitmap, bitmap)) #endif diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c index 965aa50d..2e1617a6 100644 --- a/xrdp/xrdp_listen.c +++ b/xrdp/xrdp_listen.c @@ -66,6 +66,10 @@ xrdp_listen_create(void) { log_message(LOG_LEVEL_ERROR,"xrdp_listen_create: trans_create failed"); } + else + { + self->listen_trans->is_term = g_is_term; + } return self; } @@ -199,19 +203,19 @@ xrdp_listen_get_port_address(char *port, int port_bytes, if (g_strcasecmp(val, "fork") == 0) { val = (char *)list_get_item(values, index); - startup_param->fork = text2bool(val); + startup_param->fork = g_text2bool(val); } if (g_strcasecmp(val, "tcp_nodelay") == 0) { val = (char *)list_get_item(values, index); - *tcp_nodelay = text2bool(val); + *tcp_nodelay = g_text2bool(val); } if (g_strcasecmp(val, "tcp_keepalive") == 0) { val = (char *)list_get_item(values, index); - *tcp_keepalive = text2bool(val); + *tcp_keepalive = g_text2bool(val); } } } diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index b1499984..560ebedb 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1063,11 +1063,13 @@ xrdp_mm_connect_chansrv(struct xrdp_mm *self, char *ip, char *port) { /* unix socket */ self->chan_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); + self->chan_trans->is_term = g_is_term; } else { /* tcp */ self->chan_trans = trans_create(TRANS_MODE_TCP, 8192, 8192); + self->chan_trans->is_term = g_is_term; } self->chan_trans->trans_data_in = xrdp_mm_chan_data_in; @@ -1752,6 +1754,7 @@ xrdp_mm_connect(struct xrdp_mm *self) ok = 0; trans_delete(self->sesman_trans); self->sesman_trans = trans_create(TRANS_MODE_TCP, 8192, 8192); + self->sesman_trans->is_term = g_is_term; xrdp_mm_get_sesman_port(port, sizeof(port)); g_snprintf(text, 255, "connecting to sesman ip %s port %s", ip, port); xrdp_wm_log_msg(self->wm, text); @@ -2546,7 +2549,7 @@ is_channel_enabled(char *inName, struct list *names, struct list *values) if ( index >= 0 ) { val = (char *)list_get_item(values, index); - reply = text2bool(val); + reply = g_text2bool(val); if (reply == 0) { log_message(LOG_LEVEL_INFO,"This channel is disabled: %s", inName); @@ -2799,7 +2802,7 @@ server_switch_os_surface(struct xrdp_mod *mod, int rdpindex) bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex); - if (bi != 0) + if ((bi != 0) && (bi->bitmap != 0)) { //g_writeln("server_switch_os_surface: setting target_surface to rdpid %d", id); wm->target_surface = bi->bitmap; diff --git a/xrdp/xrdp_process.c b/xrdp/xrdp_process.c index 228bf630..4c52eaac 100644 --- a/xrdp/xrdp_process.c +++ b/xrdp/xrdp_process.c @@ -203,6 +203,9 @@ xrdp_process_main_loop(struct xrdp_process *self) else { g_writeln("xrdp_process_main_loop: libxrdp_process_incomming failed"); + /* this will try to send a disconnect, + maybe should check that connection got far enough */ + libxrdp_disconnect(self->session); } /* Run end in module */ xrdp_process_mod_end(self); diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index 14ae2237..cd71c342 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -216,7 +216,8 @@ struct xrdp_cache struct xrdp_palette_item palette_items[6]; /* bitmap */ int bitmap_stamp; - struct xrdp_bitmap_item bitmap_items[3][XRDP_BITMAP_CACHE_ENTRIES]; + struct xrdp_bitmap_item bitmap_items[XRDP_MAX_BITMAP_CACHE_ID] + [XRDP_MAX_BITMAP_CACHE_IDX]; int use_bitmap_comp; int cache1_entries; int cache1_size; diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index caa74347..bba25c34 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -455,7 +455,7 @@ xrdp_wm_load_static_colors_plus(struct xrdp_wm *self, char *autorun_name) else if (g_strcasecmp(val, "hidelogwindow") == 0) { val = (char *)list_get_item(values, index); - self->hide_log_window = text2bool(val); + self->hide_log_window = g_text2bool(val); } else if (g_strcasecmp(val, "pamerrortxt") == 0) { |
