[Spice-commits] 2 commits - src/channel-webdav.c src/vmcstream.c

Pavel Grunt pgrunt at kemper.freedesktop.org
Wed Aug 10 13:34:16 UTC 2016


 src/channel-webdav.c |   43 +++++++++++++++++++------------------------
 src/vmcstream.c      |    1 -
 2 files changed, 19 insertions(+), 25 deletions(-)

New commits:
commit a0c7e6b1249089ddbfc64823ddb86b296ee92dc8
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Mon Aug 8 17:49:31 2016 +0200

    vmcstream: Do not disconnect cancellable in coroutine
    
    It is disconnected when spice_vmc_input_stream_read_all_finish()
    is called.
    
    Silence many warnings appearing with webdav:
     GLib-GObject-WARNING **: gsignal.c:2635: instance '0x7fe658015c40' has no handler with id '13555'
    
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/src/vmcstream.c b/src/vmcstream.c
index 09a296b..0634bce 100644
--- a/src/vmcstream.c
+++ b/src/vmcstream.c
@@ -165,7 +165,6 @@ spice_vmc_input_stream_co_data(SpiceVmcInputStream *self,
         cb_data->pos = self->pos;
         g_idle_add(complete_in_idle_cb, cb_data);
 
-        g_cancellable_disconnect(g_task_get_cancellable(self->task), self->cancel_id);
         g_clear_object(&self->task);
     }
 
commit 51b7766144c3a42b24792c3c6650fc0019b83081
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Mon Aug 8 17:49:18 2016 +0200

    channel-webdav: Remove extra SpiceWebdavChannel parameter
    
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 0a2ed72..4ecc769 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -218,19 +218,16 @@ client_ref(Client *client)
     return client;
 }
 
-static void client_start_read(SpiceWebdavChannel *self, Client *client);
+static void client_start_read(Client *client);
 
-static void remove_client(SpiceWebdavChannel *self, Client *client)
+static void remove_client(Client *client)
 {
-    SpiceWebdavChannelPrivate *c;
-
     if (g_cancellable_is_cancelled(client->cancellable))
         return;
 
     g_cancellable_cancel(client->cancellable);
 
-    c = self->priv;
-    g_hash_table_remove(c->clients, &client->id);
+    g_hash_table_remove(client->self->priv->clients, &client->id);
 }
 
 static void mux_pushed_cb(OutputQueue *q, gpointer user_data)
@@ -238,9 +235,9 @@ static void mux_pushed_cb(OutputQueue *q, gpointer user_data)
     Client *client = user_data;
 
     if (client->mux.size == 0) {
-        remove_client(client->self, client);
+        remove_client(client);
     } else {
-        client_start_read(client->self, client);
+        client_start_read(client);
     }
 
     client_unref(client);
@@ -253,8 +250,7 @@ static void server_reply_cb(GObject *source_object,
                             gpointer user_data)
 {
     Client *client = user_data;
-    SpiceWebdavChannel *self = client->self;
-    SpiceWebdavChannelPrivate *c = self->priv;
+    SpiceWebdavChannelPrivate *c = client->self->priv;
     GError *err = NULL;
     gssize size;
 
@@ -277,14 +273,14 @@ end:
     if (err) {
         if (!g_cancellable_is_cancelled(client->cancellable))
             g_warning("read error: %s", err->message);
-        remove_client(self, client);
+        remove_client(client);
         g_clear_error(&err);
     }
 
     client_unref(client);
 }
 
-static void client_start_read(SpiceWebdavChannel *self, Client *client)
+static void client_start_read(Client *client)
 {
     GInputStream *input;
 
@@ -297,13 +293,13 @@ static void client_start_read(SpiceWebdavChannel *self, Client *client)
 static void start_demux(SpiceWebdavChannel *self);
 
 #ifdef USE_PHODAV
-static void demux_to_client_finish(SpiceWebdavChannel *self,
-                                   Client *client, gboolean fail)
+static void demux_to_client_finish(Client *client, gboolean fail)
 {
+    SpiceWebdavChannel *self = client->self;
     SpiceWebdavChannelPrivate *c = self->priv;
 
     if (fail) {
-        remove_client(self, client);
+        remove_client(client);
     }
 
     c->demuxing = FALSE;
@@ -327,18 +323,17 @@ static void demux_to_client_cb(GObject *source, GAsyncResult *result, gpointer u
 
     fail = (size != c->demux.size);
     g_warn_if_fail(size == c->demux.size);
-    demux_to_client_finish(client->self, client, fail);
+    demux_to_client_finish(client, fail);
 }
 #endif
 
-static void demux_to_client(SpiceWebdavChannel *self,
-                            Client *client)
+static void demux_to_client(Client *client)
 {
 #ifdef USE_PHODAV
-    SpiceWebdavChannelPrivate *c = self->priv;
+    SpiceWebdavChannelPrivate *c = client->self->priv;
     gsize size = c->demux.size;
 
-    CHANNEL_DEBUG(self, "pushing %"G_GSIZE_FORMAT" to client %p", size, client);
+    CHANNEL_DEBUG(client->self, "pushing %"G_GSIZE_FORMAT" to client %p", size, client);
 
     if (size > 0) {
         g_output_stream_write_all_async(g_io_stream_get_output_stream(client->pipe),
@@ -347,7 +342,7 @@ static void demux_to_client(SpiceWebdavChannel *self,
         return;
     } else {
         /* Nothing to write */
-        demux_to_client_finish(self, client, FALSE);
+        demux_to_client_finish(client, FALSE);
     }
 #endif
 }
@@ -383,8 +378,8 @@ static void start_client(SpiceWebdavChannel *self)
 
     g_hash_table_insert(c->clients, &client->id, client);
 
-    client_start_read(self, client);
-    demux_to_client(self, client);
+    client_start_read(client);
+    demux_to_client(client);
 
     g_clear_object(&addr);
     return;
@@ -423,7 +418,7 @@ static void data_read_cb(GObject *source_object,
     client = g_hash_table_lookup(c->clients, &c->demux.client);
 
     if (client)
-        demux_to_client(self, client);
+        demux_to_client(client);
     else
         start_client(self);
 }


More information about the Spice-commits mailing list