diff options
Diffstat (limited to 'xorg/X11R7.6')
-rw-r--r-- | xorg/X11R7.6/rdp/rdp.h | 2 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmain.c | 19 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmisc.c | 7 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdprandr.c | 2 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpup.c | 38 |
5 files changed, 57 insertions, 11 deletions
diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 97e1f6c4..5db8d194 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -192,6 +192,8 @@ int g_tcp_socket(void); int g_tcp_local_socket_dgram(void); +int +g_tcp_local_socket_stream(void); void g_memcpy(void* d_ptr, const void* s_ptr, int size); int diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c index 87d78710..28c54e04 100644 --- a/xorg/X11R7.6/rdp/rdpmain.c +++ b/xorg/X11R7.6/rdp/rdpmain.c @@ -45,6 +45,11 @@ DeviceIntPtr g_keyboard = 0; Bool g_wrapWindow = 0; Bool g_wrapPixmap = 0; +/* if true, use a unix domain socket instead of a tcp socket */ +int g_use_uds = 0; +char g_uds_data[256] = ""; /* data */ +char g_uds_cont[256] = ""; /* control */ + /* set all these at once, use function set_bpp */ int g_bpp = 16; int g_Bpp = 2; @@ -503,7 +508,7 @@ ddxProcessArgument(int argc, char** argv, int i) } return 2; } - if (strcmp (argv[i], "-depth") == 0) + if (strcmp(argv[i], "-depth") == 0) { if (i + 1 >= argc) { @@ -516,6 +521,11 @@ ddxProcessArgument(int argc, char** argv, int i) } return 2; } + if (strcmp(argv[i], "-uds") == 0) + { + g_use_uds = 1; + return 1; + } return 0; } @@ -613,7 +623,7 @@ InitInput(int argc, char** argv) void ddxGiveUp(void) { - char unixSocketName[64]; + char unixSocketName[128]; ErrorF("ddxGiveUp:\n"); g_free(g_rdpScreen.pfbMemory); @@ -623,6 +633,10 @@ ddxGiveUp(void) unlink(unixSocketName); sprintf(unixSocketName, "/tmp/.xrdp/xrdp_disconnect_display_%s", display); unlink(unixSocketName); + if(g_uds_data[0] != 0) + { + unlink(g_uds_data); + } } } @@ -670,6 +684,7 @@ ddxUseMsg(void) ErrorF("X11rdp specific options\n"); ErrorF("-geometry WxH set framebuffer width & height\n"); ErrorF("-depth D set framebuffer depth\n"); + ErrorF("-uds create and listen on /tmp/.xrdp/xrdp_display_x\n"); ErrorF("\n"); exit(1); } diff --git a/xorg/X11R7.6/rdp/rdpmisc.c b/xorg/X11R7.6/rdp/rdpmisc.c index 82c5b244..5c43654a 100644 --- a/xorg/X11R7.6/rdp/rdpmisc.c +++ b/xorg/X11R7.6/rdp/rdpmisc.c @@ -264,6 +264,13 @@ g_tcp_local_socket_dgram(void) } /*****************************************************************************/ +int +g_tcp_local_socket_stream(void) +{ + return socket(AF_UNIX, SOCK_STREAM, 0); +} + +/*****************************************************************************/ void g_memcpy(void* d_ptr, const void* s_ptr, int size) { diff --git a/xorg/X11R7.6/rdp/rdprandr.c b/xorg/X11R7.6/rdp/rdprandr.c index 54e4fcf8..29f1c6e3 100644 --- a/xorg/X11R7.6/rdp/rdprandr.c +++ b/xorg/X11R7.6/rdp/rdprandr.c @@ -80,7 +80,7 @@ rdpRRGetInfo(ScreenPtr pScreen, Rotation* pRotations) } /******************************************************************************/ -/* for lack of a better way, a window is created that covers a the area and +/* for lack of a better way, a window is created that covers the area and when its deleted, it's invalidated */ static int rdpInvalidateArea(ScreenPtr pScreen, int x, int y, int cx, int cy) diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index 889ba572..b70eb8cd 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -51,6 +51,10 @@ extern int g_Bpp; /* from rdpmain.c */ extern int g_Bpp_mask; /* from rdpmain.c */ extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */ +/* true is to use unix domain socket */ +extern int g_use_uds; /* in rdpmain.c */ +extern char g_uds_data[]; /* in rdpmain.c */ + /* 0 GXclear, 0 1 GXnor, DPon @@ -457,26 +461,44 @@ rdpup_init(void) { return 0; } - g_sprintf(text, "62%2.2d", i); if (g_in_s == 0) { make_stream(g_in_s); init_stream(g_in_s, 8192); } - if (g_out_s == 0) + if (g_out_s == 0) { make_stream(g_out_s); init_stream(g_out_s, 8192 * g_Bpp + 100); } - if (g_listen_sck == 0) + if (g_use_uds) { - g_listen_sck = g_tcp_socket(); - if (g_tcp_bind(g_listen_sck, text) != 0) + g_sprintf(g_uds_data, "/tmp/.xrdp/xrdp_display_%s", display); + if (g_listen_sck == 0) { - return 0; + g_listen_sck = g_tcp_local_socket_stream(); + if (g_tcp_local_bind(g_listen_sck, g_uds_data) != 0) + { + ErrorF("rdpup_init: g_tcp_local_bind failed\n"); + return 0; + } + g_tcp_listen(g_listen_sck); + AddEnabledDevice(g_listen_sck); + } + } + else + { + g_sprintf(text, "62%2.2d", i); + if (g_listen_sck == 0) + { + g_listen_sck = g_tcp_socket(); + if (g_tcp_bind(g_listen_sck, text) != 0) + { + return 0; + } + g_tcp_listen(g_listen_sck); + AddEnabledDevice(g_listen_sck); } - g_tcp_listen(g_listen_sck); - AddEnabledDevice(g_listen_sck); } g_dis_listen_sck = g_tcp_local_socket_dgram(); if (g_dis_listen_sck != 0) |