summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-08-19 11:28:34 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-08-19 11:28:34 +0200
commitf30eb61fde728f125bf7c673cadc17f43d82a2d0 (patch)
treec8ae7fbad1d15c3611104848c1d52abccd9904c9 /methods/http.cc
parent9a64707c285290c4e191e04d92c0fab9f6f118f5 (diff)
parent889053489a8b9b91feeb698fc164446e9b5f9c67 (diff)
merged from the mvo branch
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc31
1 files changed, 18 insertions, 13 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 006e89394..1eba0f279 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -311,22 +311,27 @@ bool ServerState::Open()
Persistent = true;
// 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
- Proxy = getenv("http_proxy");
+ {
+ 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
if (getenv("no_proxy") != 0)