[glib-networking/glib-2-72] Disable libproxy resolver when running environment proxy test
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/glib-2-72] Disable libproxy resolver when running environment proxy test
- Date: Mon, 29 Aug 2022 21:05:48 +0000 (UTC)
commit 8977ad84f877df901a7950d863db9ae559058a0c
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Mon Aug 29 12:49:13 2022 -0500
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.
proxy/environment/genvironmentproxyresolver.c | 13 -------------
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 6b9150c9..e70b3bad 100644
--- a/proxy/environment/genvironmentproxyresolver.c
+++ b/proxy/environment/genvironmentproxyresolver.c
@@ -53,22 +53,9 @@ G_DEFINE_TYPE_EXTENDED (GEnvironmentProxyResolver,
g_environment_proxy_resolver_iface_init))
#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 26a9467f..c6aeb1cf 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]