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 <[email protected]> --- 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 [email protected] http://lists.freedesktop.org/mailman/listinfo/spice-devel
