[frogr] Print the right (debug) output when using proxies



commit cca9bfbbfb2df27c3d93718aa813ab00138751f9
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri May 27 19:12:25 2011 +0200

    Print the right (debug) output when using proxies

 src/frogr-controller.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 7203f6e..b36fa76 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -2010,19 +2010,25 @@ frogr_controller_set_proxy (FrogrController *self,
                                 NULL, NULL, NULL, NULL);
     DEBUG ("%s", "Not enabling the HTTP proxy");
   } else {
-    gboolean has_username = FALSE;
-    gboolean has_password = FALSE;
     gboolean proxy_changed = FALSE;
-    gchar *auth_part = NULL;
 
-    has_username = (username != NULL && *username != '\0');
-    has_password = (password != NULL && *password != '\0');
+    if (!use_gnome_proxy)
+      {
+        gchar *auth_part = NULL;
+        gboolean has_username = FALSE;
+        gboolean has_password = FALSE;
 
-    if (has_username && has_password)
-      auth_part = g_strdup_printf ("%s:%s@", username, password);
+        has_username = (username != NULL && *username != '\0');
+        has_password = (password != NULL && *password != '\0');
 
-    DEBUG ("Using HTTP proxy: %s%s:%s", auth_part ? auth_part : "", host, port);
-    g_free (auth_part);
+        if (has_username && has_password)
+          auth_part = g_strdup_printf ("%s:%s@", username, password);
+
+        DEBUG ("Using HTTP proxy: %s%s:%s", auth_part ? auth_part : "", host, port);
+        g_free (auth_part);
+      }
+    else
+      DEBUG ("Using GNOME general proxy settings");
 
     proxy_changed = fsp_session_set_http_proxy (priv->session,
                                                 use_gnome_proxy,



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