[PATCH spice-server] red-channel-client: Do not push items adding them to tail

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

 



Now the push is done automatically when a PipeItem is added
(cfr commit 5c460de1a3972b7cf2b9b2944d0b500c3affc363
"worker: push data when clients can receive them"),
forcing a push cause only network fragmentation and is required only if
you are handling data in a polling loop (and thus, you are preventing
the default event loop from running).

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/cache-item.tmpl.c    | 2 +-
 server/dcc.c                | 2 +-
 server/red-channel-client.c | 9 ---------
 server/red-channel-client.h | 1 -
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/server/cache-item.tmpl.c b/server/cache-item.tmpl.c
index 47de423bf..19e6b95f1 100644
--- a/server/cache-item.tmpl.c
+++ b/server/cache-item.tmpl.c
@@ -78,7 +78,7 @@ static void FUNC_NAME(remove)(CHANNELCLIENT *channel_client, RedCacheItem *item)
     channel_client->priv->VAR_NAME(available) += item->u.cache_data.size;
 
     red_pipe_item_init(&item->u.pipe_data, RED_PIPE_ITEM_TYPE_INVAL_ONE);
-    red_channel_client_pipe_add_tail_and_push(RED_CHANNEL_CLIENT(channel_client), &item->u.pipe_data); // for now
+    red_channel_client_pipe_add_tail(RED_CHANNEL_CLIENT(channel_client), &item->u.pipe_data); // for now
 }
 
 static int FUNC_NAME(add)(CHANNELCLIENT *channel_client, uint64_t id, size_t size)
diff --git a/server/dcc.c b/server/dcc.c
index 1e0ba790f..3bf75a707 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -470,7 +470,7 @@ void dcc_append_drawable(DisplayChannelClient *dcc, Drawable *drawable)
     RedDrawablePipeItem *dpi = red_drawable_pipe_item_new(dcc, drawable);
 
     add_drawable_surface_images(dcc, drawable);
-    red_channel_client_pipe_add_tail_and_push(RED_CHANNEL_CLIENT(dcc), &dpi->dpi_pipe_item);
+    red_channel_client_pipe_add_tail(RED_CHANNEL_CLIENT(dcc), &dpi->dpi_pipe_item);
 }
 
 void dcc_add_drawable_after(DisplayChannelClient *dcc, Drawable *drawable, RedPipeItem *pos)
diff --git a/server/red-channel-client.c b/server/red-channel-client.c
index 8f7308628..0443d6184 100644
--- a/server/red-channel-client.c
+++ b/server/red-channel-client.c
@@ -1596,15 +1596,6 @@ void red_channel_client_pipe_add_tail(RedChannelClient *rcc,
     g_queue_push_tail(&rcc->priv->pipe, item);
 }
 
-void red_channel_client_pipe_add_tail_and_push(RedChannelClient *rcc, RedPipeItem *item)
-{
-    if (!prepare_pipe_add(rcc, item)) {
-        return;
-    }
-    g_queue_push_tail(&rcc->priv->pipe, item);
-    red_channel_client_push(rcc);
-}
-
 void red_channel_client_pipe_add_type(RedChannelClient *rcc, int pipe_item_type)
 {
     RedPipeItem *item = spice_new(RedPipeItem, 1);
diff --git a/server/red-channel-client.h b/server/red-channel-client.h
index 732fbdd59..56503c44b 100644
--- a/server/red-channel-client.h
+++ b/server/red-channel-client.h
@@ -96,7 +96,6 @@ int red_channel_client_pipe_item_is_linked(RedChannelClient *rcc, RedPipeItem *i
 void red_channel_client_pipe_remove_and_release(RedChannelClient *rcc, RedPipeItem *item);
 void red_channel_client_pipe_remove_and_release_pos(RedChannelClient *rcc, GList *item_pos);
 void red_channel_client_pipe_add_tail(RedChannelClient *rcc, RedPipeItem *item);
-void red_channel_client_pipe_add_tail_and_push(RedChannelClient *rcc, RedPipeItem *item);
 /* for types that use this routine -> the pipe item should be freed */
 void red_channel_client_pipe_add_type(RedChannelClient *rcc, int pipe_item_type);
 RedPipeItem *red_channel_client_new_empty_msg(int msg_type);
-- 
2.13.5

_______________________________________________
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]