mirror of
git://git.proxmox.com/git/spiceterm.git
synced 2025-01-08 21:18:03 +03:00
allow to pass connection timeout as parameter
This commit is contained in:
parent
98537e6387
commit
11ba14dc32
3
screen.c
3
screen.c
@ -694,7 +694,7 @@ spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar2 ch, Te
|
||||
}
|
||||
|
||||
SpiceScreen *
|
||||
spice_screen_new(SpiceCoreInterface *core)
|
||||
spice_screen_new(SpiceCoreInterface *core, guint timeout)
|
||||
{
|
||||
int port = 5912;
|
||||
SpiceScreen *spice_screen = g_new0(SpiceScreen, 1);
|
||||
@ -726,7 +726,6 @@ spice_screen_new(SpiceCoreInterface *core)
|
||||
|
||||
cursor_init();
|
||||
|
||||
int timeout = 10; // max time to wait for client connection
|
||||
spice_screen->conn_timeout_timer = core->timer_add(do_conn_timeout, spice_screen);
|
||||
spice_screen->core->timer_start(spice_screen->conn_timeout_timer, timeout*1000);
|
||||
|
||||
|
@ -1602,15 +1602,15 @@ static SpiceKbdInterface my_keyboard_sif = {
|
||||
.get_leds = my_kbd_get_leds,
|
||||
};
|
||||
|
||||
spiceTerm *
|
||||
create_spiceterm(int argc, char** argv, int maxx, int maxy)
|
||||
static spiceTerm *
|
||||
create_spiceterm(int argc, char** argv, int maxx, int maxy, guint timeout)
|
||||
{
|
||||
int i;
|
||||
|
||||
SpiceScreen *spice_screen;
|
||||
|
||||
SpiceCoreInterface *core = basic_event_loop_init();
|
||||
spice_screen = spice_screen_new(core);
|
||||
spice_screen = spice_screen_new(core, timeout);
|
||||
//spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESS_OFF);
|
||||
|
||||
spiceTerm *vt = (spiceTerm *)calloc (sizeof(spiceTerm), 1);
|
||||
@ -1732,7 +1732,7 @@ main (int argc, char** argv)
|
||||
|
||||
if (0) print_usage(NULL); // fixme:
|
||||
|
||||
spiceTerm *vt = create_spiceterm (argc, argv, 745, 400);
|
||||
spiceTerm *vt = create_spiceterm (argc, argv, 745, 400, 10);
|
||||
|
||||
setlocale(LC_ALL, ""); // set from environment
|
||||
|
||||
|
@ -60,7 +60,7 @@ struct SpiceScreen {
|
||||
void (*on_client_disconnected)(SpiceScreen *spice_screen);
|
||||
};
|
||||
|
||||
SpiceScreen* spice_screen_new(SpiceCoreInterface* core);
|
||||
SpiceScreen* spice_screen_new(SpiceCoreInterface* core, guint timeout);
|
||||
|
||||
void spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar2 ch, TextAttributes attrib);
|
||||
void spice_screen_scroll(SpiceScreen *spice_screen, int x1, int y1, int x2, int y2, int src_x, int src_y);
|
||||
|
Loading…
Reference in New Issue
Block a user