[Spice-devel] [RFC v4 56/62] server/red_worker: add cursor_channel_client_disconnect

Alon Levy alevy at redhat.com
Tue Apr 26 03:55:21 PDT 2011


makes RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT disconnect only a
single client.
---
 server/red_worker.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index fcdc806..3de664a 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9922,6 +9922,15 @@ error:
     red_channel_client_destroy(&dcc->common.base);
 }
 
+static void cursor_channel_client_disconnect(RedChannelClient *rcc)
+{
+    if (!red_channel_is_connected(rcc->channel)) {
+        return;
+    }
+    red_reset_cursor_cache(rcc);
+    red_channel_client_disconnect(rcc);
+}
+
 static void red_disconnect_cursor(RedChannel *channel)
 {
     CommonChannel *common;
@@ -10587,7 +10596,7 @@ static void handle_dev_input(EventListener *listener, uint32_t events)
 
         red_printf("disconnect cursor client");
         receive_data(worker->channel, &rcc, sizeof(RedChannelClient *));
-        red_disconnect_cursor(rcc->channel); /* TODO - assumes a single client */
+        cursor_channel_client_disconnect(rcc);
         message = RED_WORKER_MESSAGE_READY;
         write_message(worker->channel, &message);
         break;
-- 
1.7.4.4



More information about the Spice-devel mailing list