]> git.proxmox.com Git - spiceterm.git/commitdiff
allow to pass connection timeout as parameter
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 12 Sep 2013 10:23:05 +0000 (12:23 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 12 Sep 2013 10:23:05 +0000 (12:23 +0200)
screen.c
spiceterm.c
spiceterm.h

index b5de7f396df07f5e6b4c4ee4cacbd8a435dd7816..231fbbe5ec9f6d2db821755d0c28b352943231ae 100644 (file)
--- a/screen.c
+++ b/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);
 
index 9208ea83dddfef25616fac2f369ce895687ff60d..3829d173eb01fe49f6b6bb2052189c2db4dbee20 100644 (file)
@@ -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
 
index a746664ebc215b174252d4607e6d7d54993c9a87..0e0e1ddb1a35d4a2db72329c3aaa58f0cc059e37 100644 (file)
@@ -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);