Re: [spice-gtk v2 11/16] channel: avoid crash on CHANNEL_DEBUG due NULL channel

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

 



On Fri, 2016-05-27 at 11:47 +0200, Victor Toso wrote:
> Hi,
> 
> On Fri, May 27, 2016 at 11:42:12AM +0200, Pavel Grunt wrote:
> > Hi,
> > 
> > I am not sure if functions working with a channel (using
> > CHANNEL_DEBUG) should work without channel. Do you know which
> > functions are causing the problem?
> > 
> > Pavel
> 
> It is also related to the tests. This function:
> https://cgit.freedesktop.org/~victortoso/spice-gtk/tree/src/spice-file-transfe
> r-task.c?h=move-xfer#n422
> 
I would rather change the function, not sure how useful is the info about the
channel in the debug message - transfer task always works with the MainChannel.

Imo "no-channel" can be confusing...

Pavel

> > 
> > On Mon, 2016-05-23 at 13:50 +0200, Victor Toso wrote:
> > > ---
> > >  src/spice-channel-priv.h | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/src/spice-channel-priv.h b/src/spice-channel-priv.h
> > > index 50aca5c..dcb5377 100644
> > > --- a/src/spice-channel-priv.h
> > > +++ b/src/spice-channel-priv.h
> > > @@ -41,7 +41,9 @@ G_BEGIN_DECLS
> > >  #define MAX_SPICE_DATA_HEADER_SIZE sizeof(SpiceDataHeader)
> > >  
> > >  #define CHANNEL_DEBUG(channel, fmt, ...) \
> > > -    SPICE_DEBUG("%s: " fmt, SPICE_CHANNEL(channel)->priv->name, ##
> > > __VA_ARGS__)
> > > +    SPICE_DEBUG("%s: " fmt, \
> > > +            (channel) ? SPICE_CHANNEL(channel)->priv->name : "no-
> > > channel", \
> > > +            ## __VA_ARGS__)
> > >  
> > >  struct _SpiceMsgOut {
> > >      int                   refcount;
_______________________________________________
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]