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

Marc-André Lureau marcandre.lureau at gmail.com
Tue Jan 29 09:23:15 PST 2013


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;
+    }


-- 
Marc-André Lureau


More information about the Spice-devel mailing list