summaryrefslogtreecommitdiffstats
path: root/server/reds.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/reds.c')
-rw-r--r--server/reds.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/reds.c b/server/reds.c
index 8ad8425d..98b316dd 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -119,6 +119,7 @@ void *red_tunnel = NULL;
#endif
int agent_mouse = TRUE;
int agent_copypaste = TRUE;
+static bool exit_on_disconnect = FALSE;
#define MIGRATE_TIMEOUT (1000 * 10) /* 10sec */
#define MM_TIMER_GRANULARITY_MS (1000 / 30)
@@ -673,6 +674,12 @@ void reds_client_disconnect(RedClient *client)
{
RedsMigTargetClient *mig_client;
+ if (exit_on_disconnect)
+ {
+ spice_info("Exiting server because of client disconnect.\n");
+ exit(0);
+ }
+
if (!client || client->disconnecting) {
return;
}
@@ -4061,6 +4068,13 @@ SPICE_GNUC_VISIBLE int spice_server_set_listen_socket_fd(SpiceServer *s, int lis
return 0;
}
+SPICE_GNUC_VISIBLE int spice_server_set_exit_on_disconnect(SpiceServer *s, int flag)
+{
+ spice_assert(reds == s);
+ exit_on_disconnect = !!flag;
+ return 0;
+}
+
SPICE_GNUC_VISIBLE int spice_server_set_noauth(SpiceServer *s)
{
spice_assert(reds == s);