[Spice-devel] [PATCH 14/26] server/red_channel: add red_channel_send_message_pending

Marc-André Lureau marcandre.lureau at gmail.com
Mon Feb 14 17:29:45 PST 2011


ack

On Fri, Feb 11, 2011 at 6:48 PM, Alon Levy <alevy at redhat.com> wrote:
> ---
>  server/red_channel.c |    5 +++++
>  server/red_channel.h |    3 +++
>  server/red_worker.c  |    2 +-
>  3 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/server/red_channel.c b/server/red_channel.c
> index 5830f4d..061c9c3 100644
> --- a/server/red_channel.c
> +++ b/server/red_channel.c
> @@ -722,3 +722,8 @@ int red_channel_any_blocked(RedChannel *channel)
>     return channel->send_data.blocked;
>  }
>
> +int red_channel_send_message_pending(RedChannel *channel)
> +{
> +    return channel->send_data.header->type != 0;
> +}
> +
> diff --git a/server/red_channel.h b/server/red_channel.h
> index 89893d4..5c776fe 100644
> --- a/server/red_channel.h
> +++ b/server/red_channel.h
> @@ -259,6 +259,9 @@ int red_channel_all_blocked(RedChannel *channel);
>  /* return TRUE if any of the connected clients to this channel are blocked */
>  int red_channel_any_blocked(RedChannel *channel);
>
> +/* helper for channels that have complex logic that can possibly ready a send */
> +int red_channel_send_message_pending(RedChannel *channel);
> +
>  // TODO: unstaticed for display/cursor channels. they do some specific pushes not through
>  // adding elements or on events. but not sure if this is actually required (only result
>  // should be that they ""try"" a little harder, but if the event system is correct it
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 58d6a38..59d9cbe 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -7132,7 +7132,7 @@ static void red_lossy_send_qxl_drawable(RedWorker *worker, DisplayChannel *displ
>     }
>
>     // a message is pending
> -    if (display_channel->common.base.send_data.header->type != 0) {
> +    if (red_channel_send_message_pending(&display_channel->common.base)) {
>         display_begin_send_message(display_channel);
>     }
>  }
> --
> 1.7.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list