diff options
author | Michael Catanzaro <mcatanzaro@redhat.com> | 2022-08-29 12:49:13 -0500 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2022-08-29 21:05:40 +0000 |
commit | 419f4b8a3850d00b5a951c45dfeac2e32146fea4 (patch) | |
tree | 8aca300033df88e75e9dc264fad930681cd101b9 | |
parent | 794d252073a7aafd046db94bfa2ba7096bd3edb8 (diff) | |
download | glib-networking-419f4b8a3850d00b5a951c45dfeac2e32146fea4.tar.gz |
Disable libproxy resolver when running environment proxy test
After reversing the priority of the environment proxy vs. libproxy
proxy resolvers, I forgot to also reverse the logic that ensures the
correct resolver gets used when running tests.
Part-of: <https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/222>
-rw-r--r-- | proxy/environment/genvironmentproxyresolver.c | 13 | ||||
-rw-r--r-- | proxy/libproxy/glibproxyresolver.c | 9 |
2 files changed, 8 insertions, 14 deletions
diff --git a/proxy/environment/genvironmentproxyresolver.c b/proxy/environment/genvironmentproxyresolver.c index 6b9150c..e70b3ba 100644 --- a/proxy/environment/genvironmentproxyresolver.c +++ b/proxy/environment/genvironmentproxyresolver.c @@ -54,21 +54,8 @@ G_DEFINE_TYPE_EXTENDED (GEnvironmentProxyResolver, #endif static gboolean -is_running_libproxy_test (void) -{ - const char *gio_proxy_test_name; - gio_proxy_test_name = g_getenv ("GIO_PROXY_TEST_NAME"); - if (g_strcmp0 (gio_proxy_test_name, "libproxy") == 0) - return TRUE; - return FALSE; -} - -static gboolean g_environment_proxy_resolver_is_supported (GProxyResolver *object) { - if (is_running_libproxy_test ()) - return FALSE; - return (g_getenv ("ftp_proxy") || g_getenv ("FTP_PROXY") || g_getenv ("https_proxy") || g_getenv ("HTTPS_PROXY") || g_getenv ("http_proxy") || g_getenv ("HTTP_PROXY") || diff --git a/proxy/libproxy/glibproxyresolver.c b/proxy/libproxy/glibproxyresolver.c index e1c5a60..3d84af5 100644 --- a/proxy/libproxy/glibproxyresolver.c +++ b/proxy/libproxy/glibproxyresolver.c @@ -73,10 +73,17 @@ g_libproxy_resolver_finalize (GObject *object) G_OBJECT_CLASS (g_libproxy_resolver_parent_class)->finalize (object); } +static gboolean +is_running_environment_proxy_test (void) +{ + return g_strcmp0 (g_getenv ("GIO_PROXY_TEST_NAME"), "environment") == 0; +} + static void g_libproxy_resolver_init (GLibproxyResolver *resolver) { - resolver->factory = px_proxy_factory_new (); + if (!is_running_environment_proxy_test ()) + resolver->factory = px_proxy_factory_new (); } static gboolean |