diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-08-24 13:30:05 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-08-24 13:30:05 +0200 |
commit | f408836a80f20359c87d8815608af651199e3d73 (patch) | |
tree | 68223e0ef145325ccb75b4c25df7579236260e19 /methods/https.cc | |
parent | 04876c50b8416ee0736b3233f968ecc805a5e05c (diff) | |
parent | c6aa14e46842b0059c1648125562793e5edd08ee (diff) |
merged from the mvo 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 |