libsoup r1271 - in trunk: . libsoup



Author: danw
Date: Mon Apr 13 14:04:54 2009
New Revision: 1271
URL: http://svn.gnome.org/viewvc/libsoup?rev=1271&view=rev

Log:
	Bug 578746 â http_proxy env var set to "http://:80"; in session
	despite proxy mode "none"

	* libsoup/soup-proxy-resolver-gnome.c (update_proxy_settings):
	Don't set anything if proxy_mode is NONE, and properly ignore the
	proxy host if it's empty.


Modified:
   trunk/ChangeLog
   trunk/libsoup/soup-proxy-resolver-gnome.c

Modified: trunk/libsoup/soup-proxy-resolver-gnome.c
==============================================================================
--- trunk/libsoup/soup-proxy-resolver-gnome.c	(original)
+++ trunk/libsoup/soup-proxy-resolver-gnome.c	Mon Apr 13 14:04:54 2009
@@ -183,14 +183,20 @@
 	mode = gconf_client_get_string (
 		gconf_client, SOUP_GCONF_PROXY_MODE, NULL);
 	if (!mode || !gconf_string_to_enum (proxy_mode_map, mode,
-					    (int *)&proxy_mode)) {
+					    (int *)&proxy_mode))
 		proxy_mode = SOUP_PROXY_RESOLVER_GNOME_MODE_NONE;
-		g_free (mode);
-		return;
-	}
 	g_free (mode);
 
-	if (proxy_mode == SOUP_PROXY_RESOLVER_GNOME_MODE_AUTO) {
+	if (proxy_mode == SOUP_PROXY_RESOLVER_GNOME_MODE_NONE) {
+		if (libproxy_factory) {
+			/* Unset anything we previously set */
+			g_unsetenv ("PX_CONFIG_ORDER");
+			g_unsetenv ("http_proxy");
+			g_unsetenv ("https_proxy");
+			g_unsetenv ("no_proxy");
+		}
+		return;
+	} else if (proxy_mode == SOUP_PROXY_RESOLVER_GNOME_MODE_AUTO) {
 		char *autoconfig_url;
 
 		autoconfig_url = gconf_client_get_string (
@@ -206,7 +212,7 @@
 
 		host = gconf_client_get_string (
 			gconf_client, SOUP_GCONF_HTTP_PROXY_HOST, NULL);
-		if (!host && !*host) {
+		if (!host || !*host) {
 			g_free (host);
 			proxy_mode = SOUP_PROXY_RESOLVER_GNOME_MODE_NONE;
 			return;



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