[Spice-devel] [PATCH spice-server] Add a comment to red_channel_client_init_send_data

Frediano Ziglio fziglio at redhat.com
Thu Nov 24 13:57:22 UTC 2016


> 
> On Thu, Nov 24, 2016 at 10:48:24AM +0000, Frediano Ziglio wrote:
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/red-channel-client.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/server/red-channel-client.h b/server/red-channel-client.h
> > index 94b4f58..93d0315 100644
> > --- a/server/red-channel-client.h
> > +++ b/server/red-channel-client.h
> > @@ -89,6 +89,9 @@ void red_channel_client_shutdown(RedChannelClient *rcc);
> >  int red_channel_client_handle_message(RedChannelClient *rcc, uint32_t
> >  size,
> >                                        uint16_t type, void *message);
> >  /* when preparing send_data: should call init and then use marshaller */
> > +/* item is retained as long as the message is sent to the client,
> 
> "The item is retained", then I don't understand when the item stops
> being retained. "The item is only released after the message has been
> sent to the client" ?
> 
> > + * this is used for instance to make sure an attached data referenced
> 
> "This is used for instance to make sure attached data ..."
> 
> > + * by the marshaller is still valid when data are used */
> 
> and I would say "when it's used"
> 
> Maybe better to wait for Jonathon's input on the phrasing?
> 
> Christophe
> 

I'll wait, in the meantime I updated the commit log.

What's not clear with this API is when to pass the item and when not.
Basically when there is a spice_marshaller_add_ref in the code that
send the item potentially it's required to pass the item to
red_channel_client_init_send_data, otherwise passing NULL will free
the item when *_send_item returns (if not references elsewhere).

Frediano


More information about the Spice-devel mailing list