core: Support a per-remote "proxy" configuration option

We don't want to have to force people to set it in the environment.

https://bugzilla.gnome.org/show_bug.cgi?id=733734
This commit is contained in:
Colin Walters committed 2014-07-28 13:49:38 -04:00
1 parent 43bba232a0
commit b97a5f59df
4 files changed
+37 -10

No files matched your search

+17 -10
View File
@@ -172,16 +172,7 @@ _ostree_fetcher_init (OstreeFetcher *self)
http_proxy = g_getenv ("http_proxy");
if (http_proxy)
{
SoupURI *proxy_uri = soup_uri_new (http_proxy);
if (!proxy_uri)
{
g_warning ("Invalid proxy URI '%s'", http_proxy);
}
else
{
g_object_set (self->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
soup_uri_free (proxy_uri);
}
_ostree_fetcher_set_proxy (self, http_proxy);
}
if (g_getenv ("OSTREE_DEBUG_HTTP"))
@@ -224,6 +215,22 @@ _ostree_fetcher_new (GFile *tmpdir,
return self;
}
void
_ostree_fetcher_set_proxy (OstreeFetcher *self,
const char *http_proxy)
{
SoupURI *proxy_uri = soup_uri_new (http_proxy);
if (!proxy_uri)
{
g_warning ("Invalid proxy URI '%s'", http_proxy);
}
else
{
g_object_set (self->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
soup_uri_free (proxy_uri);
}
}
void
_ostree_fetcher_set_client_cert (OstreeFetcher *fetcher,
GTlsCertificate *cert)