[Spice-commits] server/red_worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Wed Dec 2 04:49:35 PST 2015


 server/red_worker.c |   49 ++++++++++++++++---------------------------------
 1 file changed, 16 insertions(+), 33 deletions(-)

New commits:
commit 1c9aea02c6badf2ffb640050de3d23b4ed5f8728
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Thu Oct 3 21:35:59 2013 +0200

    worker: merge handle_new_display_channel
    
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/red_worker.c b/server/red_worker.c
index 6045ae5..ffd1508 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -949,31 +949,6 @@ static void guest_set_client_capabilities(RedWorker *worker)
     }
 }
 
-static void handle_new_display_channel(RedWorker *worker, RedClient *client, RedsStream *stream,
-                                       int migrate,
-                                       uint32_t *common_caps, int num_common_caps,
-                                       uint32_t *caps, int num_caps)
-{
-    DisplayChannel *display;
-    DisplayChannelClient *dcc;
-
-    spice_return_if_fail(worker->display_channel);
-
-    display = worker->display_channel;
-    spice_info("add display channel client");
-    dcc = dcc_new(display, client, stream, migrate,
-                  common_caps, num_common_caps, caps, num_caps,
-                  worker->image_compression, worker->jpeg_state, worker->zlib_glz_state);
-    if (!dcc) {
-        return;
-    }
-
-    display_channel_update_compression(display, dcc);
-
-    guest_set_client_capabilities(worker);
-    dcc_start(dcc);
-}
-
 static void cursor_connect(RedWorker *worker, RedClient *client, RedsStream *stream,
                            int migrate,
                            uint32_t *common_caps, int num_common_caps,
@@ -1336,14 +1311,22 @@ static void handle_dev_display_connect(void *opaque, void *payload)
 {
     RedWorkerMessageDisplayConnect *msg = payload;
     RedWorker *worker = opaque;
-    RedsStream *stream = msg->stream;
-    RedClient *client = msg->client;
-    int migration = msg->migration;
-
-    spice_info("connect");
-    handle_new_display_channel(worker, client, stream, migration,
-                               msg->common_caps, msg->num_common_caps,
-                               msg->caps, msg->num_caps);
+    DisplayChannel *display = worker->display_channel;
+    DisplayChannelClient *dcc;
+
+    spice_info("connect new client");
+    spice_return_if_fail(display);
+
+    dcc = dcc_new(display, msg->client, msg->stream, msg->migration,
+                  msg->common_caps, msg->num_common_caps, msg->caps, msg->num_caps,
+                  worker->image_compression, worker->jpeg_state, worker->zlib_glz_state);
+    if (!dcc) {
+        return;
+    }
+    display_channel_update_compression(display, dcc);
+    guest_set_client_capabilities(worker);
+    dcc_start(dcc);
+
     free(msg->caps);
     free(msg->common_caps);
 }


More information about the Spice-commits mailing list