|
|
|
@ -153,6 +153,7 @@ static int
|
|
|
|
|
xrdp_listen_get_port_address(char *port, int port_bytes,
|
|
|
|
|
char *address, int address_bytes,
|
|
|
|
|
int *tcp_nodelay, int *tcp_keepalive,
|
|
|
|
|
int *mode,
|
|
|
|
|
struct xrdp_startup_params *startup_param)
|
|
|
|
|
{
|
|
|
|
|
int fd;
|
|
|
|
@ -170,6 +171,7 @@ xrdp_listen_get_port_address(char *port, int port_bytes,
|
|
|
|
|
/* see if port or address is in xrdp.ini file */
|
|
|
|
|
g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH);
|
|
|
|
|
fd = g_file_open(cfg_file);
|
|
|
|
|
*mode = TRANS_MODE_TCP;
|
|
|
|
|
*tcp_nodelay = 0 ;
|
|
|
|
|
*tcp_keepalive = 0 ;
|
|
|
|
|
|
|
|
|
@ -204,7 +206,16 @@ xrdp_listen_get_port_address(char *port, int port_bytes,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if defined(XRDP_ENABLE_VSOCK)
|
|
|
|
|
if (g_strcasecmp(val, "use_vsock") == 0)
|
|
|
|
|
{
|
|
|
|
|
val = (char *)list_get_item(values, index);
|
|
|
|
|
if (g_text2bool(val) == 1)
|
|
|
|
|
{
|
|
|
|
|
*mode = TRANS_MODE_VSOCK;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if (g_strcasecmp(val, "address") == 0)
|
|
|
|
|
{
|
|
|
|
|
val = (char *)list_get_item(values, index);
|
|
|
|
@ -355,6 +366,7 @@ xrdp_listen_main_loop(struct xrdp_listen *self)
|
|
|
|
|
if (xrdp_listen_get_port_address(port, sizeof(port),
|
|
|
|
|
address, sizeof(address),
|
|
|
|
|
&tcp_nodelay, &tcp_keepalive,
|
|
|
|
|
&self->listen_trans->mode,
|
|
|
|
|
self->startup_params) != 0)
|
|
|
|
|
{
|
|
|
|
|
log_message(LOG_LEVEL_ERROR,"xrdp_listen_main_loop: xrdp_listen_get_port failed");
|
|
|
|
@ -369,6 +381,13 @@ xrdp_listen_main_loop(struct xrdp_listen *self)
|
|
|
|
|
/* not valid with UDS */
|
|
|
|
|
tcp_nodelay = 0;
|
|
|
|
|
}
|
|
|
|
|
#if defined(XRDP_ENABLE_VSOCK)
|
|
|
|
|
else if (self->listen_trans->mode == TRANS_MODE_VSOCK)
|
|
|
|
|
{
|
|
|
|
|
/* not valid with VSOCK */
|
|
|
|
|
tcp_nodelay = 0;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Create socket */
|
|
|
|
|
error = trans_listen_address(self->listen_trans, port, address);
|
|
|
|
@ -563,6 +582,7 @@ xrdp_listen_test(void)
|
|
|
|
|
{
|
|
|
|
|
int rv = 0;
|
|
|
|
|
char port[128];
|
|
|
|
|
int mode;
|
|
|
|
|
char address[256];
|
|
|
|
|
int tcp_nodelay;
|
|
|
|
|
int tcp_keepalive;
|
|
|
|
@ -579,6 +599,7 @@ xrdp_listen_test(void)
|
|
|
|
|
if (xrdp_listen_get_port_address(port, sizeof(port),
|
|
|
|
|
address, sizeof(address),
|
|
|
|
|
&tcp_nodelay, &tcp_keepalive,
|
|
|
|
|
&mode,
|
|
|
|
|
xrdp_listen->startup_params) != 0)
|
|
|
|
|
{
|
|
|
|
|
log_message(LOG_LEVEL_DEBUG, "xrdp_listen_test: "
|
|
|
|
|