[Spice-devel] [PATCH spice-server] main-channel-client: Do not call red_channel_client_begin_send_message if we are not sending a message

Christophe Fergeau cfergeau at redhat.com
Tue Dec 19 16:22:02 UTC 2017


On Tue, Dec 19, 2017 at 11:38:26AM +0000, Frediano Ziglio wrote:
> 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 at redhat.com>
> ---
>  server/main-channel-client.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/server/main-channel-client.c b/server/main-channel-client.c
> index 07435073e..ebdef3f43 100644
> --- a/server/main-channel-client.c
> +++ b/server/main-channel-client.c
> @@ -1052,8 +1052,9 @@ void main_channel_client_send_item(RedChannelClient *rcc, RedPipeItem *base)
>              if (mcc->priv->initial_channels_list_sent) {
>                  main_channel_marshall_registered_channel(rcc, m,
>                      SPICE_UPCAST(RedRegisteredChannelPipeItem, base));
> +                break;
>              }
> -            break;
> +            return;

I think this would be easier to read:

if (!mcc->priv->initial_channels_list_sent) {
    return;
}
main_channel_marshall_registered_channel(rcc, m, SPICE_UPCAST(RedRegisteredChannelPipeItem, base));
break;

Otherwise,
Acked-by: Christophe Fergeau <cfergeau at redhat.com>

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20171219/fe49aa22/attachment.sig>


More information about the Spice-devel mailing list