diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-08-19 11:27:00 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-08-19 11:27:00 +0200 |
commit | 889053489a8b9b91feeb698fc164446e9b5f9c67 (patch) | |
tree | c8ae7fbad1d15c3611104848c1d52abccd9904c9 /methods/https.cc | |
parent | 194f3443c4c405e86f4094efa37269a8b3b7e3e3 (diff) | |
parent | bbf55f8c66325fd0d9262730fb7af25fa25d2c5f (diff) |
merged from the jackyf-devel branch
Diffstat (limited to 'methods/https.cc')
-rw-r--r-- | methods/https.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/methods/https.cc b/methods/https.cc index 8bf44b52a..37d93e308 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -61,19 +61,26 @@ void HttpsMethod::SetupProxy() URI ServerName = Queue->Uri; // Determine the proxy setting - if (getenv("http_proxy") == 0) + string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host); + if (!SpecificProxy.empty()) { - string DefProxy = _config->Find("Acquire::http::Proxy"); - string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host); - if (SpecificProxy.empty() == false) - { - if (SpecificProxy == "DIRECT") - Proxy = ""; - else - Proxy = SpecificProxy; - } - else - Proxy = DefProxy; + if (SpecificProxy == "DIRECT") + Proxy = ""; + else + Proxy = SpecificProxy; + } + else + { + string DefProxy = _config->Find("Acquire::http::Proxy"); + if (!DefProxy.empty()) + { + Proxy = DefProxy; + } + else + { + char* result = getenv("http_proxy"); + Proxy = result ? result : ""; + } } // Parse no_proxy, a , separated list of domains |