Re: [PATCH spice-gtk] Add SpiceSession:proxy

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

 



On Tue, Jan 29, 2013 at 06:23:15PM +0100, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Jan 29, 2013 at 6:09 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> > On Tue, Jan 29, 2013 at 06:01:34PM +0100, Marc-André Lureau wrote:
> >> On Tue, Jan 29, 2013 at 5:54 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> >> > update_proxy(session, NULL); will never unset an already set proxy.
> >>
> >>
> >> If SPICE_PROXY is set, it will replace it if it's a valid value.
> >>
> >> If SPICE_PROXY is not set, it won't replace it, keep current proxy. Is
> >> that a problem?
> >
> > I think so,
> > g_object_set (session, "proxy", "http://example.com:8000";, NULL);
> > g_object_set (session, "proxy", NULL, NULL);
> > will not do what is expected (unset the proxy), will it?
> >
> 
> So in short, you would want to clear, if both str argument is NULL and
> SPICE_PROXY is NULL:
> 
>     if (str == NULL)
>          str = g_getenv("SPICE_PROXY");
> -    if (str == NULL || *str == 0)
> +    if (str == NULL || *str == 0) {
> +        g_clear_object(&s->proxy);
>          return;
> +    }
> 

Yes, exactly, this seems like the behaviour users of this API would expect,
no?

Christophe

Attachment: pgplWOMsXzEr6.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]