vnc: Added delay_ms option. Fixes neutrinolabs/xrdp#182
This commit is contained in:
parent
605df27103
commit
6ddc43c4fc
11
vnc/vnc.c
11
vnc/vnc.c
@ -979,6 +979,13 @@ lib_mod_connect(struct vnc *v)
|
|||||||
|
|
||||||
v->sck_obj = g_create_wait_obj_from_socket(v->sck, 0);
|
v->sck_obj = g_create_wait_obj_from_socket(v->sck, 0);
|
||||||
v->sck_closed = 0;
|
v->sck_closed = 0;
|
||||||
|
if (v->delay_ms > 0)
|
||||||
|
{
|
||||||
|
g_sprintf(text, "Waiting %d ms for VNC to start...", v->delay_ms);
|
||||||
|
v->server_msg(v, text, 0);
|
||||||
|
g_sleep(v->delay_ms);
|
||||||
|
}
|
||||||
|
|
||||||
g_sprintf(text, "VNC connecting to %s %s", v->ip, con_port);
|
g_sprintf(text, "VNC connecting to %s %s", v->ip, con_port);
|
||||||
v->server_msg(v, text, 0);
|
v->server_msg(v, text, 0);
|
||||||
error = g_tcp_connect(v->sck, v->ip, con_port);
|
error = g_tcp_connect(v->sck, v->ip, con_port);
|
||||||
@ -1331,6 +1338,10 @@ lib_mod_set_param(struct vnc *v, char *name, char *value)
|
|||||||
{
|
{
|
||||||
v->keylayout = g_atoi(value);
|
v->keylayout = g_atoi(value);
|
||||||
}
|
}
|
||||||
|
else if (g_strcasecmp(name, "delay_ms") == 0)
|
||||||
|
{
|
||||||
|
v->delay_ms = g_atoi(value);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -115,4 +115,5 @@ struct vnc
|
|||||||
char* clip_data;
|
char* clip_data;
|
||||||
int clip_data_size;
|
int clip_data_size;
|
||||||
tbus sck_obj;
|
tbus sck_obj;
|
||||||
|
int delay_ms;
|
||||||
};
|
};
|
||||||
|
@ -156,6 +156,7 @@ username=ask
|
|||||||
password=ask
|
password=ask
|
||||||
ip=127.0.0.1
|
ip=127.0.0.1
|
||||||
port=-1
|
port=-1
|
||||||
|
#delay_ms=2000
|
||||||
|
|
||||||
[xrdp3]
|
[xrdp3]
|
||||||
name=console
|
name=console
|
||||||
@ -164,6 +165,7 @@ ip=127.0.0.1
|
|||||||
port=5900
|
port=5900
|
||||||
username=na
|
username=na
|
||||||
password=ask
|
password=ask
|
||||||
|
#delay_ms=2000
|
||||||
|
|
||||||
[xrdp4]
|
[xrdp4]
|
||||||
name=vnc-any
|
name=vnc-any
|
||||||
@ -175,6 +177,7 @@ password=ask
|
|||||||
#pamusername=asksame
|
#pamusername=asksame
|
||||||
#pampassword=asksame
|
#pampassword=asksame
|
||||||
#pamsessionmng=127.0.0.1
|
#pamsessionmng=127.0.0.1
|
||||||
|
#delay_ms=2000
|
||||||
|
|
||||||
[xrdp5]
|
[xrdp5]
|
||||||
name=sesman-any
|
name=sesman-any
|
||||||
@ -183,6 +186,7 @@ ip=ask
|
|||||||
port=-1
|
port=-1
|
||||||
username=ask
|
username=ask
|
||||||
password=ask
|
password=ask
|
||||||
|
#delay_ms=2000
|
||||||
|
|
||||||
[xrdp6]
|
[xrdp6]
|
||||||
name=rdp-any
|
name=rdp-any
|
||||||
|
Loading…
Reference in New Issue
Block a user