gnome-terminal r2762 - trunk/src



Author: chpe
Date: Thu May 29 19:51:51 2008
New Revision: 2762
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2762&view=rev

Log:
Fix http_proxy env var being set when using non-manual proxy mode. Bug #343811, patch by John Spray.


Modified:
   trunk/src/terminal-screen.c

Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c	(original)
+++ trunk/src/terminal-screen.c	Thu May 29 19:51:51 2008
@@ -1141,7 +1141,9 @@
 {
   GtkWidget *term;
   char **env, **p, **retval;
-  gint i;
+  char *proxymode, *proxyhost;
+  gboolean use_proxy;
+  int i;
   GConfClient *conf;
 #define EXTRA_ENV_VARS 8
 
@@ -1188,8 +1190,27 @@
   
   conf = gconf_client_get_default ();
 
-  if (!getenv ("http_proxy") &&
-      gconf_client_get_bool (conf, HTTP_PROXY_DIR "/use_http_proxy", NULL))
+  /* Series of conditions under which we don't set http_proxy */
+  use_proxy = gconf_client_get_bool (conf, HTTP_PROXY_DIR "/use_http_proxy", NULL);
+
+  /* Is the mode unset or not equal to "manual"? */
+  proxymode = gconf_client_get_string (conf, "/system/proxy/mode", NULL);
+  if (!proxymode || strcmp (proxymode, "manual") != 0)
+    use_proxy = FALSE;
+  g_free (proxymode);
+
+  /* Do we already have a proxy setting? */
+  if (getenv ("http_proxy"))
+    use_proxy = FALSE;
+
+  /* Do we have no proxy host or an empty string? */
+  proxyhost = gconf_client_get_string (conf, HTTP_PROXY_DIR "/host", NULL);
+  if (!proxyhost || proxyhost[0] == '\0')
+    use_proxy = FALSE;
+  g_free (proxyhost);
+
+  /* Set up proxy environment variables if we passed all of the above */
+  if (use_proxy)
     {
       gint port;
       GSList *ignore;



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