http ftp proxy support
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:53:47 +0000 (16:53 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:53:47 +0000 (16:53 +0000)
Author: jgg
Date: 1999-05-23 06:33:13 GMT
http ftp proxy support

debian/changelog
doc/sources.list.5.yo
methods/ftp.cc

index 4bfe442..79c6d6c 100644 (file)
@@ -11,7 +11,9 @@ apt (0.3.6.1) unstable; urgency=low
   * Added a check for an empty cache directory. Closes: #37963
   * Return a failure code if -d is given and packages fail to download.
     Closes: #38127
-  
+  * Arranged for an ftp proxy specifing an http server to work. See the
+    important note in the sources.list man page.
+    
  -- Jason Gunthorpe <jgg@debian.org>  Wed, 12 May 1999 09:18:49 -0700
  
 apt (0.3.6) unstable; urgency=low
index e468ce3..605f46c 100644 (file)
@@ -86,7 +86,11 @@ Note that this is an insecure method of authentication.
 dit(bf(ftp))
 The ftp scheme specifies an FTP server for the archive. APT's FTP behavior
 is highly configurable; for more information see the
-bf(apt.conf(5)) manual page.
+bf(apt.conf(5)) manual page. Please note that a ftp proxy can be specified
+by using the ftp_proxy environment variable. It is possible to specify a http
+proxy (http proxy servers often understand ftp urls) using this method and 
+ONLY this method. ftp proxies using http specified in the configuration 
+file will be ignored.
 
 dit(bf(copy))
 The copy scheme is identical to the file scheme except that packages are
index d72a44e..4686e79 100644 (file)
@@ -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();