about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2008-02-09 13:58:54 +0000
committerGraham Barr <gbarr@pobox.com>2009-02-24 10:40:48 -0600
commit02bef53e74ef3e7f7f8257f32ffa1a507845bbf2 (patch)
tree4b489567b73c5de4e43e6387315554573f32727b
parent38626190f26a01e8fd311a2ade1a7a1e802c3271 (diff)
downloadperl-libnet-02bef53e74ef3e7f7f8257f32ffa1a507845bbf2.tar.gz
Add ->passive method to switch between PORT/PASV connections
-rw-r--r--Net/FTP.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index a99592e..581a16c 100644
--- a/Net/FTP.pm
+++ b/Net/FTP.pm
@@ -124,6 +124,12 @@ sub host {
   ${*$me}{'net_ftp_host'};
 }
 
+sub passive {
+  my $ftp = shift;
+  return ${*$ftp}{'net_ftp_passive'} unless @_;
+  ${*$ftp}{'net_ftp_passive'} = shift;
+}
+
 
 sub hash {
   my $ftp = shift;    # self
@@ -1439,6 +1445,10 @@ to change the directory to the root directory.
 
 Change directory to the parent of the current directory.
 
+=item passive ( [ PASSIVE ] )
+
+Set or get if data connections will be initiated in passive mode.
+
 =item pwd ()
 
 Returns the full pathname of the current directory.