[Spice-devel] [PATCH] channel: simplify red_channel_client_send_item
Pavel Grunt
pgrunt at redhat.com
Thu Jan 14 05:43:43 PST 2016
Acked-by: Pavel Grunt <pgrunt at redhat.com>
On Thu, 2016-01-14 at 13:38 +0000, Frediano Ziglio wrote:
> ---
> server/red-channel.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/server/red-channel.c b/server/red-channel.c
> index 704f319..306c87d 100644
> --- a/server/red-channel.c
> +++ b/server/red-channel.c
> @@ -560,33 +560,26 @@ static void
> red_channel_client_send_ping(RedChannelClient *rcc)
>
> static void red_channel_client_send_item(RedChannelClient *rcc,
> PipeItem *item)
> {
> - int handled = TRUE;
> -
> spice_assert(red_channel_client_no_item_being_sent(rcc));
> red_channel_client_reset_send_data(rcc);
> switch (item->type) {
> case PIPE_ITEM_TYPE_SET_ACK:
> red_channel_client_send_set_ack(rcc);
> - free(item);
> break;
> case PIPE_ITEM_TYPE_MIGRATE:
> red_channel_client_send_migrate(rcc);
> - free(item);
> break;
> case PIPE_ITEM_TYPE_EMPTY_MSG:
> red_channel_client_send_empty_msg(rcc, item);
> - free(item);
> break;
> case PIPE_ITEM_TYPE_PING:
> red_channel_client_send_ping(rcc);
> - free(item);
> break;
> default:
> - handled = FALSE;
> - }
> - if (!handled) {
> - rcc->channel->channel_cbs.send_item(rcc, item);
> + rcc->channel->channel_cbs.send_item(rcc, item);
> + return;
> }
> + free(item);
> }
>
> static void red_channel_client_release_item(RedChannelClient *rcc,
> PipeItem *item, int item_pushed)
More information about the Spice-devel
mailing list