]> git.saurik.com Git - apt.git/commitdiff
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 4bfe44249ab7e0a171b3edcfb4e49ad0aeb4a6e6..79c6d6c2d864b13c649f8edca62f65ac6a452e58 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
   * 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
  -- Jason Gunthorpe <jgg@debian.org>  Wed, 12 May 1999 09:18:49 -0700
  
 apt (0.3.6) unstable; urgency=low
index e468ce3d42dc040a9e772f47621fce0996b34bd5..605f46c50759308ae764ebcc2ee4900c65bb217f 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
 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
 
 dit(bf(copy))
 The copy scheme is identical to the file scheme except that packages are
index d72a44ea3e8aeabbac94d7dd0bb44453a836be0f..4686e79f83c001138afec50c973f40e6ada50fc6 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- 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.
 /* ######################################################################
 
    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();
    FtpMethod Mth;
    
    return Mth.Run();