[PATCH spice-server 6/6] red-channel: Do not push data calling red_channel_pipes_new_add_push

[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 loop instead of using the
default loop.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/display-channel.c |  4 ++--
 server/red-channel.c     | 17 ++++-------------
 server/red-channel.h     |  3 +--
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index 792fbd25..14700df0 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -2396,7 +2396,7 @@ void display_channel_update_compression(DisplayChannel *display, DisplayChannelC
 
 void display_channel_gl_scanout(DisplayChannel *display)
 {
-    red_channel_pipes_new_add_push(RED_CHANNEL(display), dcc_gl_scanout_item_new, NULL);
+    red_channel_pipes_new_add(RED_CHANNEL(display), dcc_gl_scanout_item_new, NULL);
 }
 
 static void set_gl_draw_async_count(DisplayChannel *display, int num)
@@ -2416,7 +2416,7 @@ void display_channel_gl_draw(DisplayChannel *display, SpiceMsgDisplayGlDraw *dra
 
     spice_return_if_fail(display->priv->gl_draw_async_count == 0);
 
-    num = red_channel_pipes_new_add_push(RED_CHANNEL(display), dcc_gl_draw_item_new, draw);
+    num = red_channel_pipes_new_add(RED_CHANNEL(display), dcc_gl_draw_item_new, draw);
     set_gl_draw_async_count(display, num);
 }
 
diff --git a/server/red-channel.c b/server/red-channel.c
index 490447ed..777ad8e2 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -597,20 +597,11 @@ static int red_channel_pipes_create_batch(RedChannel *channel,
     return n;
 }
 
-int red_channel_pipes_new_add_push(RedChannel *channel,
-                                   new_pipe_item_t creator, void *data)
+int red_channel_pipes_new_add(RedChannel *channel,
+                              new_pipe_item_t creator, void *data)
 {
-    int n = red_channel_pipes_create_batch(channel, creator, data,
-                                           red_channel_client_pipe_add);
-    red_channel_push(channel);
-
-    return n;
-}
-
-void red_channel_pipes_new_add(RedChannel *channel, new_pipe_item_t creator, void *data)
-{
-    red_channel_pipes_create_batch(channel, creator, data,
-                                     red_channel_client_pipe_add);
+    return red_channel_pipes_create_batch(channel, creator, data,
+                                          red_channel_client_pipe_add);
 }
 
 uint32_t red_channel_max_pipe_size(RedChannel *channel)
diff --git a/server/red-channel.h b/server/red-channel.h
index c965baee..f2dd0836 100644
--- a/server/red-channel.h
+++ b/server/red-channel.h
@@ -167,8 +167,7 @@ void red_channel_init_outgoing_messages_window(RedChannel *channel);
 
 // helper to push a new item to all channels
 typedef RedPipeItem *(*new_pipe_item_t)(RedChannelClient *rcc, void *data, int num);
-int red_channel_pipes_new_add_push(RedChannel *channel, new_pipe_item_t creator, void *data);
-void red_channel_pipes_new_add(RedChannel *channel, new_pipe_item_t creator, void *data);
+int red_channel_pipes_new_add(RedChannel *channel, new_pipe_item_t creator, void *data);
 
 void red_channel_pipes_add_type(RedChannel *channel, int pipe_item_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]