diff options
author | Laxmikant Rashinkar <lk@Ubuntu-12.04-32bit> | 2014-10-11 14:49:46 -0700 |
---|---|---|
committer | Laxmikant Rashinkar <lk@Ubuntu-12.04-32bit> | 2014-10-11 14:49:46 -0700 |
commit | 8c316b46b8d6b1cb3cf32165daf817030aac1a47 (patch) | |
tree | 089c5741cb2a914501e5ab28898a5c71c4c4103b /xrdp/xrdp_listen.c | |
parent | 5b6b74577fda4bbcd0a02a585d783c59d68953da (diff) | |
parent | bc7a6b9bc66afe4adf7c232c94e41694319d4155 (diff) | |
download | xrdp-proprietary-8c316b46b8d6b1cb3cf32165daf817030aac1a47.tar.gz xrdp-proprietary-8c316b46b8d6b1cb3cf32165daf817030aac1a47.zip |
Merge branch 'devel'
Diffstat (limited to 'xrdp/xrdp_listen.c')
-rw-r--r-- | xrdp/xrdp_listen.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c index 5d7edf83..b2b19ca2 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. @@ -60,6 +60,7 @@ xrdp_listen_create(void) g_process_sem = tc_sem_create(0); } + /* setting TCP mode now, may change later */ self->listen_trans = trans_create(TRANS_MODE_TCP, 16, 16); if (self->listen_trans == 0) @@ -168,7 +169,7 @@ xrdp_listen_get_port_address(char *port, int port_bytes, *tcp_nodelay = 0 ; *tcp_keepalive = 0 ; - if (fd > 0) + if (fd != -1) { names = list_create(); names->auto_free = 1; @@ -186,12 +187,18 @@ xrdp_listen_get_port_address(char *port, int port_bytes, if (g_strcasecmp(val, "port") == 0) { val = (char *)list_get_item(values, index); - error = g_atoi(val); - - if ((error > 0) && (error < 65000)) + if (val[0] == '/') { g_strncpy(port, val, port_bytes - 1); } + else + { + error = g_atoi(val); + if ((error > 0) && (error < 65000)) + { + g_strncpy(port, val, port_bytes - 1); + } + } } if (g_strcasecmp(val, "address") == 0) @@ -235,9 +242,11 @@ xrdp_listen_get_port_address(char *port, int port_bytes, list_delete(names); list_delete(values); - g_file_close(fd); } + if (fd != -1) + g_file_close(fd); + /* startup_param overrides */ if (startup_param->port[0] != 0) { @@ -348,7 +357,15 @@ xrdp_listen_main_loop(struct xrdp_listen *self) return 1; } - /*Create socket*/ + if (port[0] == '/') + { + /* set UDS mode */ + self->listen_trans->mode = TRANS_MODE_UNIX; + /* not valid with UDS */ + tcp_nodelay = 0; + } + + /* Create socket */ error = trans_listen_address(self->listen_trans, port, address); if (error == 0) @@ -433,7 +450,7 @@ xrdp_listen_main_loop(struct xrdp_listen *self) robjs[robjs_count++] = done_obj; timeout = -1; - if (self->listen_trans != 0) + /* if (self->listen_trans != 0) */ { if (trans_get_wait_objs(self->listen_trans, robjs, &robjs_count) != 0) |