summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>2006-01-26 23:21:16 -0800
committerGisle Aas <gisle@activestate.com>2006-01-27 19:48:28 +0000
commit8460ac15db2c40d1c6f63e30e61207343dddc0f6 (patch)
treeea0607cf50cf71b5fe002d9bfce99c5f06a92c35 /lib/Net
parentd9f4b51dad32ad3a7291b88415b07813e05962d0 (diff)
downloadperl-8460ac15db2c40d1c6f63e30e61207343dddc0f6.tar.gz
Re: Make Passive mode the default for Net::FTP
Message-ID: <lrslr91ytv.fsf@caliper.activestate.com> p4raw-id: //depot/perl@26970
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/Config.pm13
-rw-r--r--lib/Net/FTP.pm16
2 files changed, 19 insertions, 10 deletions
diff --git a/lib/Net/Config.pm b/lib/Net/Config.pm
index a502abe751..185f2927cb 100644
--- a/lib/Net/Config.pm
+++ b/lib/Net/Config.pm
@@ -27,8 +27,8 @@ eval { local $SIG{__DIE__}; require Net::LocalCfg };
time_hosts => [],
inet_domain => undef,
ftp_firewall => undef,
- ftp_ext_passive => 0,
- ftp_int_passive => 0,
+ ftp_ext_passive => 1,
+ ftp_int_passive => 1,
test_hosts => 1,
test_exist => 1,
);
@@ -269,11 +269,12 @@ There is no firewall
=item ftp_int_passive
-FTP servers normally work on a non-passive mode. That is when you want to
-transfer data you have to tell the server the address and port to
-connect to.
+FTP servers can work in passive or active mode. Active mode is when
+you want to transfer data you have to tell the server the address and
+port to connect to. Passive mode is when the server provide the
+address and port and you establish the connection.
-With some firewalls this does not work as the server cannot
+With some firewalls active mode does not work as the server cannot
connect to your machine (because you are behind a firewall) and the firewall
does not re-write the command. In this case you should set C<ftp_ext_passive>
to a I<true> value.
diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm
index 7dfe0ab5f4..6b15b9c755 100644
--- a/lib/Net/FTP.pm
+++ b/lib/Net/FTP.pm
@@ -1332,10 +1332,18 @@ B<Timeout> - Set a timeout value (defaults to 120)
B<Debug> - debug level (see the debug method in L<Net::Cmd>)
-B<Passive> - If set to a non-zero value then all data transfers will be done
-using passive mode. This is not usually required except for some I<dumb>
-servers, and some firewall configurations. This can also be set by the
-environment variable C<FTP_PASSIVE>.
+B<Passive> - If set to a non-zero value then all data transfers will
+be done using passive mode. If set to zero then data transfers will be
+done using active mode. If the machine is connected to the Internet
+directly, both passive and active mode should work equally well.
+Behind most firewall and NAT configurations passive mode has a better
+chance of working. However, in some rare firewall configurations,
+active mode actually works when passive mode doesn't. Some really old
+FTP servers might not implement passive transfers. If not specified,
+then the transfer mode is set by the environment variable
+C<FTP_PASSIVE> or if that one is not set by the settings done by the
+F<libnetcfg> utility. If none of these apply then passive mode is
+used.
B<Hash> - If given a reference to a file handle (e.g., C<\*STDERR>),
print hash marks (#) on that filehandle every 1024 bytes. This