[PATCH] Delay the exit call for the exit on disconnect function.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will allow client cleanup to happen.

Signed-off-by: Jeremy White <jwhite@xxxxxxxxxxxxxxx>
---
 server/reds.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index c235421..e380dd1 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -559,12 +559,6 @@ void reds_client_disconnect(RedsState *reds, RedClient *client)
 {
     RedsMigTargetClient *mig_client;
 
-    if (reds->config->exit_on_disconnect)
-    {
-        spice_info("Exiting server because of client disconnect.\n");
-        exit(0);
-    }
-
     if (!client || client->disconnecting) {
         spice_debug("client %p already during disconnection", client);
         return;
@@ -599,6 +593,12 @@ void reds_client_disconnect(RedsState *reds, RedClient *client)
     reds->num_clients--;
     red_client_destroy(client);
 
+    if (reds->config->exit_on_disconnect)
+    {
+        spice_info("Exiting server because of client disconnect.\n");
+        exit(0);
+    }
+
    // TODO: we need to handle agent properly for all clients!!!! (e.g., cut and paste, how? Maybe throw away messages
    // if we are in the middle of one from another client)
     if (reds->num_clients == 0) {
-- 
2.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]