Re: wget bug with ftp/passive

2004-08-12 Thread Jeff Connelly
On Wed, 21 Jan 2004 23:07:30 -0800, you wrote:
Hello,
I think I've come across a little bug in wget when using it to get a file
via ftp.

I did not specify the passive option, yet it appears to have been used
anyway Here's a short transcript:
Passive FTP can be specified in /etc/wgetrc or /usr/local/etc/wgetrc, and then
its impossible to turn it off. There is no --active-mode flag as far
as I can tell.

I submitted a patch to wget-patches under the title of 
Patch to add --active-ftp and make --passive-ftp default, which does
what it says.
Your configuration is setting passive mode to default, but the stock
wget defaults
to active (active mode doesn't work too well behind some firewalls).
--active-ftp is
a very useful option in these cases.

Last I checked, the patch hasn't been committed. I can't find the wget-patches
mail archives anywhere, either. So I'll paste it here, in hopes that it helps.

-Jeff Connelly

=cut here=
Common subdirectories: doc.orig/ChangeLog-branches and doc/ChangeLog-branches
diff -u doc.orig/wget.pod doc/wget.pod
--- doc.orig/wget.pod   Wed Jul 21 20:17:29 2004
+++ doc/wget.podWed Jul 21 20:18:56 2004
@@ -888,12 +888,17 @@
 system-specific.  This is why it currently works only with Unix FTP
 servers (and the ones emulating Unix Cls output).

+=item B--active-ftp
+
+Use the Iactive FTP retrieval scehme, in which the server
+initiates the data connection. This is sometimes required to connect
+to FTP servers that are behind firewalls.

 =item B--passive-ftp

 Use the Ipassive FTP retrieval scheme, in which the client
 initiates the data connection.  This is sometimes required for FTP
-to work behind firewalls.
+to work behind firewalls, and as such is enabled by default.


 =item B--retr-symlinks
Common subdirectories: src.orig/.libs and src/.libs
Common subdirectories: src.orig/ChangeLog-branches and src/ChangeLog-branches
diff -u src.orig/init.c src/init.c
--- src.orig/init.c Wed Jul 21 20:17:33 2004
+++ src/init.c  Wed Jul 21 20:17:59 2004
@@ -255,6 +255,7 @@
   opt.ftp_glob = 1;
   opt.htmlify = 1;
   opt.http_keep_alive = 1;
+  opt.ftp_pasv = 1;
   opt.use_proxy = 1;
   tmp = getenv (no_proxy);
   if (tmp)
diff -u src.orig/main.c src/main.c
--- src.orig/main.c Wed Jul 21 20:17:33 2004
+++ src/main.c  Wed Jul 21 20:17:59 2004
@@ -217,7 +217,8 @@
 FTP options:\n\
   -nr, --dont-remove-listing   don\'t remove `.listing\' files.\n\
   -g,  --glob=on/off   turn file name globbing on or off.\n\
-   --passive-ftp   use the \passive\ transfer mode.\n\
+   --passive-ftp   use the \passive\ transfer mode (default).\n\
+   --active-ftpuse the \active\ transfer mode.\n\
--retr-symlinks when recursing, get linked-to files (not dirs).\
n\
 \n), stdout);
   fputs (_(\
@@ -285,6 +286,7 @@
 { no-parent, no_argument, NULL, 133 },
 { non-verbose, no_argument, NULL, 146 },
 { passive-ftp, no_argument, NULL, 139 },
+{ active-ftp, no_argument, NULL, 167 },
 { page-requisites, no_argument, NULL, 'p' },
 { quiet, no_argument, NULL, 'q' },
 { random-wait, no_argument, NULL, 165 },
@@ -397,6 +399,9 @@
case 139:
  setval (passiveftp, on);
  break;
+case 167:
+  setval (passiveftp, off);
+  break;
case 141:
  setval (noclobber, on);
  break;


Re: wget bug with ftp/passive

2004-01-22 Thread Hrvoje Niksic
don [EMAIL PROTECTED] writes:

 I did not specify the passive option, yet it appears to have been used
 anyway Here's a short transcript:

 [EMAIL PROTECTED] sim390]$ wget ftp://musicm.mcgill.ca/sim390/sim390dm.zip
 --21:05:21--  ftp://musicm.mcgill.ca/sim390/sim390dm.zip
= `sim390dm.zip'
 Resolving musicm.mcgill.ca... done.
 Connecting to musicm.mcgill.ca[132.206.120.4]:21... connected.
 Logging in as anonymous ... Logged in!
 == SYST ... done.== PWD ... done.
 == TYPE I ... done.  == CWD /sim390 ... done.
 == PASV ...
 Cannot initiate PASV transfer.

Are you sure that something else hasn't done it for you?  For example,
a system-wide initialization file `/usr/local/etc/wgetrc' or
`/etc/wgetrc'.