[Spice-devel] [RFCv5 39/47] server/red_worker: add cursor_channel_client_disconnect

Alon Levy alevy at redhat.com
Sun May 8 06:11:35 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 3fe5832..d911613 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9943,6 +9943,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;
@@ -10606,7 +10615,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.5.1



More information about the Spice-devel mailing list