main-channel-client: Do not call red_channel_client_begin_send_message if we are not sending a message

In case mcc->priv->initial_channels_list_sent is false we didn't
marshall any message so we should not call
red_channel_client_begin_send_message.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-12-06 16:46:13 +00:00
parent f7ca5d4a15
commit 521353639b

View File

@ -1049,10 +1049,11 @@ void main_channel_client_send_item(RedChannelClient *rcc, RedPipeItem *base)
* message from the client before sending any CHANNEL_LIST message. If
* we've already sent our initial CHANNELS_LIST message, then it should be
* safe to send new ones for newly-registered channels. */
if (mcc->priv->initial_channels_list_sent) {
main_channel_marshall_registered_channel(rcc, m,
SPICE_UPCAST(RedRegisteredChannelPipeItem, base));
if (!mcc->priv->initial_channels_list_sent) {
return;
}
main_channel_marshall_registered_channel(rcc, m,
SPICE_UPCAST(RedRegisteredChannelPipeItem, base));
break;
default:
break;