[glib-networking] proxy/gnome: fix automatic mode



commit 1e9e918c2b30ca359a05d515c297524b3e5c245d
Author: Dan Winship <danw gnome org>
Date:   Mon Apr 22 15:15:48 2013 -0400

    proxy/gnome: fix automatic mode
    
    Automatic proxy resolution mode was accidentally getting more-or-less
    ignored and treated as "none".

 proxy/gnome/gproxyresolvergnome.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/proxy/gnome/gproxyresolvergnome.c b/proxy/gnome/gproxyresolvergnome.c
index d47c6e5..4cdba0a 100644
--- a/proxy/gnome/gproxyresolvergnome.c
+++ b/proxy/gnome/gproxyresolvergnome.c
@@ -225,14 +225,23 @@ update_settings (GProxyResolverGnome *resolver)
       resolver->pacrunner = NULL;
     }
 
-  if (resolver->mode != G_DESKTOP_PROXY_MODE_MANUAL)
-    return;
-
   ignore_hosts =
     g_settings_get_strv (resolver->proxy_settings, GNOME_PROXY_IGNORE_HOSTS_KEY);
   g_simple_proxy_resolver_set_ignore_hosts (simple, ignore_hosts);
   g_strfreev (ignore_hosts);
 
+  if (resolver->mode == G_DESKTOP_PROXY_MODE_AUTO)
+    {
+      /* We use the base_resolver to handle ignore_hosts in the AUTO case,
+       * so we have to set a non-"direct://" default proxy so we can distinguish
+       * the two cases.
+       */
+       g_simple_proxy_resolver_set_default_proxy (simple, "use-proxy:");
+    }
+
+  if (resolver->mode != G_DESKTOP_PROXY_MODE_MANUAL)
+    return;
+
   host = g_settings_get_string (resolver->http_settings, GNOME_PROXY_HTTP_HOST_KEY);
   port = g_settings_get_int (resolver->http_settings, GNOME_PROXY_HTTP_PORT_KEY);
   if (host && *host)


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