[Spice-devel] [RFC v4 19/62] server/red_channel: add RedChannel.clients_num
Marc-André Lureau
marcandre.lureau at gmail.com
Mon May 2 16:52:45 PDT 2011
On Tue, Apr 26, 2011 at 12:54 PM, Alon Levy <alevy at redhat.com> wrote:
> +static void red_channel_client_unlink(RedChannelClient *rcc)
> +{
> + ring_remove(&rcc->client_link);
> + rcc->client->channels_num--;
> + ASSERT(rcc->channel->rcc == rcc);
> + rcc->channel->rcc = NULL;
> + rcc->channel->clients_num--;
> +}
For consistency with the add(),it would be preferable to have a
red_channel_remove_client(RedChannel *channel, RedChannelClient *rcc)
instead.
> void red_channel_client_disconnect(RedChannelClient *rcc)
> {
> red_printf("%p (channel %p)", rcc, rcc->channel);
> @@ -873,7 +883,7 @@ void red_channel_client_disconnect(RedChannelClient *rcc)
> rcc->send_data.item = NULL;
> rcc->send_data.blocked = FALSE;
> rcc->send_data.size = 0;
> - rcc->channel->rcc = NULL;
> + red_channel_client_unlink(rcc);
> }
>
> void red_channel_disconnect(RedChannel *channel)
> @@ -1037,12 +1047,6 @@ static void red_client_add_channel(RedClient *client, RedChannelClient *rcc)
> client->channels_num++;
> }
>
> -void red_client_remove_channel(RedClient *client, RedChannelClient *rcc)
> -{
> - ring_remove(&rcc->client_link);
> - client->channels_num--;
> -}
> -
To merge with 13/62 server: Add RedClient
--
Marc-André Lureau
More information about the Spice-devel
mailing list