[Spice-devel] [PATCH spice-gtk] Add SpiceSession:proxy

Christophe Fergeau cfergeau at redhat.com
Wed Jan 30 01:24:22 PST 2013


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 at redhat.com> 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 at redhat.com> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130130/7eddd7d7/attachment.pgp>


More information about the Spice-devel mailing list