Przeglądaj źródła

http ftp proxy support
Author: jgg
Date: 1999-05-23 06:33:13 GMT
http ftp proxy support

Arch Librarian 22 lat temu
rodzic
commit
d448932232
3 zmienionych plików z 30 dodań i 4 usunięć
  1. 3 1
      debian/changelog
  2. 5 1
      doc/sources.list.5.yo
  3. 22 2
      methods/ftp.cc

+ 3 - 1
debian/changelog

@@ -11,7 +11,9 @@ apt (0.3.6.1) unstable; urgency=low
   * Added a check for an empty cache directory. Closes: #37963
   * Added a check for an empty cache directory. Closes: #37963
   * Return a failure code if -d is given and packages fail to download.
   * Return a failure code if -d is given and packages fail to download.
     Closes: #38127
     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
  -- Jason Gunthorpe <jgg@debian.org>  Wed, 12 May 1999 09:18:49 -0700
  
  
 apt (0.3.6) unstable; urgency=low
 apt (0.3.6) unstable; urgency=low

+ 5 - 1
doc/sources.list.5.yo

@@ -86,7 +86,11 @@ Note that this is an insecure method of authentication.
 dit(bf(ftp))
 dit(bf(ftp))
 The ftp scheme specifies an FTP server for the archive. APT's FTP behavior
 The ftp scheme specifies an FTP server for the archive. APT's FTP behavior
 is highly configurable; for more information see the
 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))
 dit(bf(copy))
 The copy scheme is identical to the file scheme except that packages are
 The copy scheme is identical to the file scheme except that packages are

+ 22 - 2
methods/ftp.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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;
    FtpMethod Mth;
    
    
    return Mth.Run();
    return Mth.Run();