red-channel: Do not push data calling red_channel_pipes_new_add_push

Now the push is done automatically when a PipeItem is added
(cfr commit 5c460de1a3
"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@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-08-29 11:25:32 +01:00
parent ee929dd43a
commit bfaf660a05
3 changed files with 7 additions and 17 deletions

View File

@ -2376,7 +2376,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)
@ -2396,7 +2396,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);
}

View File

@ -596,20 +596,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)

View File

@ -165,8 +165,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);