summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:54 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:54 +0000
commit9e2a06ff63968286395f3426b689cf7c3914a883 (patch)
tree49b24f723dc1da9ece033dea5602649b88bcb633 /methods
parent5f3edc0fb8a81755a5237c0f189dd55ab9f453d9 (diff)
no_proxy environment variable
Author: jgg Date: 1999-10-18 03:18:40 GMT no_proxy environment variable
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/methods/http.cc b/methods/http.cc
index c4a3f1629..34f2f1af5 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: http.cc,v 1.38 1999/10/03 21:09:27 jgg Exp $
+// $Id: http.cc,v 1.39 1999/10/18 03:18:40 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the HTTP aquire method for APT.
@@ -289,6 +289,27 @@ bool ServerState::Open()
else
Proxy = getenv("http_proxy");
+ // Parse no_proxy, a , seperated list of hosts
+ if (getenv("no_proxy") != 0)
+ {
+ const char *Start = getenv("no_proxy");
+ for (const char *Cur = Start; true ; Cur++)
+ {
+ if (*Cur != ',' && *Cur != 0)
+ continue;
+ if (stringcasecmp(ServerName.Host.begin(),ServerName.Host.end(),
+ Start,Cur) == 0)
+ {
+ Proxy = "";
+ break;
+ }
+
+ Start = Cur + 1;
+ if (*Cur == 0)
+ break;
+ }
+ }
+
// Determine what host and port to use based on the proxy settings
int Port = 0;
string Host;