diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-03-15 21:42:39 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-03-15 21:42:39 -0700 |
commit | e9c58226ba20efb6389d976acb9eb8e339b02df7 (patch) | |
tree | 6430c30a3353136837542790efcab38f13a91be5 /xup/xup.c | |
parent | ffa5149a8f2e3f4eedb7206ac2cdcd2f104e8d3e (diff) | |
download | xrdp-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.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -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)) |