summaryrefslogtreecommitdiff
path: root/methods/ftp.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:53:47 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:53:47 +0000
commitd44893223244d859057820954b8dd2e61324ad08 (patch)
treea584ef1ecb55a9d252c69496e01212f9d2674baa /methods/ftp.cc
parente42eb508e01f4de6def088fe941344d3ca733fa5 (diff)
http ftp proxy support
Author: jgg Date: 1999-05-23 06:33:13 GMT http ftp proxy support
Diffstat (limited to 'methods/ftp.cc')
-rw-r--r--methods/ftp.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index d72a44ea3..4686e79f8 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: ftp.cc,v 1.7 1999/04/17 23:18:11 jgg Exp $
+// $Id: ftp.cc,v 1.8 1999/05/23 06:33:13 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the FTP aquire method for APT.
@@ -910,8 +910,28 @@ bool FtpMethod::Fetch(FetchItem *Itm)
}
/*}}}*/
-int main()
+int main(int argc,const char *argv[])
{
+ /* See if we should be come the http client - we do this for http
+ proxy urls */
+ if (getenv("ftp_proxy") != 0)
+ {
+ URI Proxy = string(getenv("ftp_proxy"));
+ if (Proxy.Access == "http")
+ {
+ // Copy over the environment setting
+ char S[300];
+ snprintf(S,sizeof(S),"http_proxy=%s",getenv("ftp_proxy"));
+ putenv(S);
+
+ // Run the http method
+ string Path = flNotFile(argv[0]) + "/http";
+ execl(Path.c_str(),Path.c_str());
+ cerr << "Unable to invoke " << Path << endl;
+ exit(100);
+ }
+ }
+
FtpMethod Mth;
return Mth.Run();