lib: Check for http_proxy being the empty string
On at least one user's computer, g_getenv("http_proxy") returns the
empty string, so check for that and treat it as no proxy rather than
printing a warning.
See https://github.com/flatpak/flatpak/issues/2790
Closes: #1835
Approved by: cgwalters
This commit is contained in:
parent
c9725d0bef
commit
da57956327
|
|
@ -645,7 +645,7 @@ _ostree_fetcher_constructed (GObject *object)
|
||||||
}
|
}
|
||||||
|
|
||||||
http_proxy = g_getenv ("http_proxy");
|
http_proxy = g_getenv ("http_proxy");
|
||||||
if (http_proxy != NULL)
|
if (http_proxy != NULL && http_proxy[0] != '\0')
|
||||||
_ostree_fetcher_set_proxy (self, http_proxy);
|
_ostree_fetcher_set_proxy (self, http_proxy);
|
||||||
|
|
||||||
/* FIXME Maybe implement GInitableIface and use g_thread_try_new()
|
/* FIXME Maybe implement GInitableIface and use g_thread_try_new()
|
||||||
|
|
@ -711,7 +711,7 @@ _ostree_fetcher_set_proxy (OstreeFetcher *self,
|
||||||
SoupURI *proxy_uri;
|
SoupURI *proxy_uri;
|
||||||
|
|
||||||
g_return_if_fail (OSTREE_IS_FETCHER (self));
|
g_return_if_fail (OSTREE_IS_FETCHER (self));
|
||||||
g_return_if_fail (http_proxy != NULL);
|
g_return_if_fail (http_proxy != NULL && http_proxy[0] != '\0');
|
||||||
|
|
||||||
proxy_uri = soup_uri_new (http_proxy);
|
proxy_uri = soup_uri_new (http_proxy);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3034,7 +3034,7 @@ _ostree_repo_remote_new_fetcher (OstreeRepo *self,
|
||||||
&http_proxy, error))
|
&http_proxy, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (http_proxy != NULL)
|
if (http_proxy != NULL && http_proxy[0] != '\0')
|
||||||
_ostree_fetcher_set_proxy (fetcher, http_proxy);
|
_ostree_fetcher_set_proxy (fetcher, http_proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue