diff options
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | lib/Net/FTP.pm | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,7 @@ libnet 1.28 -- TODO + * Don't use the ALLO command on FTP servers that don't support it. [Resolves + CPAN RT#95717] * Stop Makefile.PL from requiring interactive configuration when running via cpan, cpanp or cpanm: just accept all defaults in these cases, as when running non-interactively. [Resolves CPAN RT#48966] diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm index eb8e7dc..e8b2d95 100644 --- a/lib/Net/FTP.pm +++ b/lib/Net/FTP.pm @@ -490,7 +490,7 @@ sub alloc { unless (defined $size); return - unless ($ftp->_ALLO($size, @_)); + unless ($ftp->supported("ALLO") and $ftp->_ALLO($size, @_)); ${*$ftp}{'net_ftp_allo'} = join(" ", $size, @_); @@ -1148,7 +1148,9 @@ sub _data_cmd { return unless $ok; - if ($cmd =~ /(STOR|APPE|STOU)/ and exists ${*$ftp}{net_ftp_allo}) { + if ($cmd =~ /(STOR|APPE|STOU)/ and exists ${*$ftp}{net_ftp_allo} and + $ftp->supported("ALLO")) + { $ftp->_ALLO(delete ${*$ftp}{net_ftp_allo}) or return; } |