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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]