summaryrefslogtreecommitdiffstats
path: root/xup/xup.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-03-15 21:42:39 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-03-15 21:42:39 -0700
commite9c58226ba20efb6389d976acb9eb8e339b02df7 (patch)
tree6430c30a3353136837542790efcab38f13a91be5 /xup/xup.c
parentffa5149a8f2e3f4eedb7206ac2cdcd2f104e8d3e (diff)
downloadxrdp-proprietary-e9c58226ba20efb6389d976acb9eb8e339b02df7.tar.gz
xrdp-proprietary-e9c58226ba20efb6389d976acb9eb8e339b02df7.zip
use unix domain socket for xrdp-X11rdp connection
Diffstat (limited to 'xup/xup.c')
-rw-r--r--xup/xup.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/xup/xup.c b/xup/xup.c
index e3397bc3..46683417 100644
--- a/xup/xup.c
+++ b/xup/xup.c
@@ -130,6 +130,7 @@ lib_mod_connect(struct mod* mod)
int len;
int i;
int index;
+ int use_uds;
struct stream* s;
char con_port[256];
@@ -156,15 +157,34 @@ lib_mod_connect(struct mod* mod)
}
make_stream(s);
g_sprintf(con_port, "%s", mod->port);
+ use_uds = 0;
+ if (con_port[0] == '/')
+ {
+ use_uds = 1;
+ }
mod->sck_closed = 0;
i = 0;
while (1)
{
- mod->sck = g_tcp_socket();
+ if (use_uds)
+ {
+ mod->sck = g_tcp_local_socket();
+ }
+ else
+ {
+ mod->sck = g_tcp_socket();
+ }
g_tcp_set_non_blocking(mod->sck);
g_tcp_set_no_delay(mod->sck);
mod->server_msg(mod, "connecting...", 0);
- error = g_tcp_connect(mod->sck, mod->ip, con_port);
+ if (use_uds)
+ {
+ error = g_tcp_local_connect(mod->sck, con_port);
+ }
+ else
+ {
+ error = g_tcp_connect(mod->sck, mod->ip, con_port);
+ }
if (error == -1)
{
if (g_tcp_last_error_would_block(mod->sck))