[Spice-devel] [PATCH spice-gtk 5/6] spice-channel: Move read only check to spice_channel_write_msg()

Marc-André Lureau marcandre.lureau at gmail.com
Fri Dec 2 08:52:13 PST 2011


ack

On Thu, Dec 1, 2011 at 4:48 PM, Hans de Goede <hdegoede at redhat.com> wrote:
> This is a preparation patch for removing spice_channel_send_msg().
>
> Note that this means that buffered writes won't get checked until they are
> actually send by the co-routine.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/spice-channel.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index e8f0831..7878fb4 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -690,6 +690,12 @@ static void spice_channel_write_msg(SpiceChannel *channel, SpiceMsgOut *out)
>     g_return_if_fail(out != NULL);
>     g_return_if_fail(channel == out->channel);
>
> +    if (out->ro_check &&
> +        spice_channel_get_read_only(channel)) {
> +        g_warning("Try to send message while read-only. Please report a bug.");
> +        return;
> +    }
> +
>     out->header->size =
>         spice_marshaller_get_total_size(out->marshaller) - sizeof(SpiceDataHeader);
>     data = spice_marshaller_linearize(out->marshaller, 0, &len, &free_data);
> @@ -1568,12 +1574,6 @@ static void spice_channel_send_msg(SpiceChannel *channel, SpiceMsgOut *out, gboo
>     g_return_if_fail(channel != NULL);
>     g_return_if_fail(out != NULL);
>
> -    if (out->ro_check &&
> -        spice_channel_get_read_only(channel)) {
> -        g_warning("Try to send message while read-only. Please report a bug.");
> -        return;
> -    }
> -
>     if (buffered) {
>         spice_msg_out_ref(out);
>         g_queue_push_tail(&c->xmit_queue, out);
> --
> 1.7.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