[Spice-devel] [spice-server 04/10] Remove IncomingHandlerInterface::{alloc, release}_msg_buf

Christophe Fergeau cfergeau at redhat.com
Fri Feb 10 15:23:10 UTC 2017


On Fri, Feb 10, 2017 at 08:17:47AM -0500, Frediano Ziglio wrote:
> > 
> > On Tue, 2017-02-07 at 11:59 +0100, Christophe Fergeau wrote:
> > > Similarly to the previous commits, this removes an indirection level,
> > > IncomingHandlerInterface stores pointers to
> > > alloc_recv_buf/release_recv_buf vfuncs, but these are always set to
> > > RedChannel::alloc_recv_buf/RedChannel::release_recv_buf, which are
> > > also
> > > vfuncs which can be overridden if needed. This commit removes the
> > > indirection and directly calls the relevant methods.
> > > 
> > > Not sure whether the corresponding vfuncs belong in
> > > RedChannel or if they should be moved to RedChannelClient.
> > 
> > They do seem more appropriate to RedChannelClient, since the first
> > argument is RedChannelClient*. If we do move them, it could be done in
> > a subsequent commit, though. Maybe more of this stuff should be moved
> > to the client?
> > 
> 
> For me it's quite obvious.

==

> RedChannel with RedChannelClient handle a channel.
> The separation allows to handle multiple clients or having a channel
> with no clients attached (this last could be easily achieved without
> RedChannelClient by the way).
> RedChannelClient have the responsibility of dealing with a client
> so for instance has a stream while RedChannel don't.
> The RedChannelClient should deal with client state allowing the
> channel to send different data if the client states are different
> or filter messages based on client properties (for instance you
> can think of an input channel connected to a client that is not
> allowed to send input commands).

==

I would add something like this as some high-level documentation for
RedChannelClient somewhere in the source.

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


More information about the Spice-devel mailing list