Fix the -p option in tests/get again
authorDan Winship <danw@src.gnome.org>
Fri, 3 Apr 2009 00:49:43 +0000 (00:49 +0000)
committerDan Winship <danw@src.gnome.org>
Fri, 3 Apr 2009 00:49:43 +0000 (00:49 +0000)
svn path=/trunk/; revision=1261

tests/get.c

index 714d6bd..9efed35 100644 (file)
@@ -293,7 +293,6 @@ main (int argc, char **argv)
        if (synchronous) {
                session = soup_session_sync_new_with_options (
                        SOUP_SESSION_SSL_CA_FILE, cafile,
-                       SOUP_SESSION_PROXY_URI, proxy,
 #ifdef HAVE_GNOME
                        SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_GNOME_FEATURES_2_26,
 #endif
@@ -302,7 +301,6 @@ main (int argc, char **argv)
        } else {
                session = soup_session_async_new_with_options (
                        SOUP_SESSION_SSL_CA_FILE, cafile,
-                       SOUP_SESSION_PROXY_URI, proxy,
 #ifdef HAVE_GNOME
                        SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_GNOME_FEATURES_2_26,
 #endif
@@ -310,6 +308,16 @@ main (int argc, char **argv)
                        NULL);
        }
 
+       /* Need to do this after creating the session, since adding
+        * SOUP_TYPE_GNOME_FEATURE_2_26 will add a proxy resolver, thereby
+        * bashing over the manually-set proxy.
+        */
+       if (proxy) {
+               g_object_set (G_OBJECT (session), 
+                             SOUP_SESSION_PROXY_URI, proxy,
+                             NULL);
+       }
+
        if (recurse) {
                char *outdir;