diff options
author | Eugene V. Lyubimkin <jackyf@1501-debian> | 2008-12-15 21:17:39 +0200 |
---|---|---|
committer | Eugene V. Lyubimkin <jackyf@1501-debian> | 2008-12-15 21:17:39 +0200 |
commit | 788a8f42c1ec146c812550d076e5fb720e83ae52 (patch) | |
tree | 5cdb4e7b98f3bbb57fb76def64c4a334cbf89279 /methods/https.cc | |
parent | fef5d395460ad45c097e8563c8b822173a9ae918 (diff) | |
download | apt-788a8f42c1ec146c812550d076e5fb720e83ae52.tar.gz |
Make apt proxy options have the highest priority, unified proxy determining code.
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 98dfeefa1..728869fa2 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 |