diff options
author | Graham Barr <gbarr@pobox.com> | 2008-02-10 00:39:36 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2009-02-24 10:40:49 -0600 |
commit | 0d616e68ccd1acba2203847af1c6b59f8134e37f (patch) | |
tree | 7bdb9ba2a7e744c93f93e21184b4e5d35cc2144b | |
parent | 294c44c5961c6a7fa973b3b32b40099040a81684 (diff) | |
download | perl-libnet-0d616e68ccd1acba2203847af1c6b59f8134e37f.tar.gz |
Send ALLO command just before the store command
-rw-r--r-- | Net/FTP.pm | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -711,7 +711,7 @@ sub _store_cmd { # a pipe, or device) and if so get the file size from stat, and send # an ALLO command before sending the STOR, STOU, or APPE command. my $size = do { local $^W; -f $local && -s _ }; # no ALLO if sending data from a pipe - $ftp->_ALLO($size) if $size; + ${*$ftp}{'net_ftp_allo'} = $size if $size; } croak("Bad remote filename '$remote'\n") if defined($remote) and $remote =~ /[\r\n]/s; @@ -1043,6 +1043,11 @@ sub _data_cmd { return undef unless $ok; + if ($cmd =~ /(STOR|APPE|STOU)/ and exists ${*$ftp}{net_ftp_allo}) { + $ftp->_ALLO(delete ${*$ftp}{net_ftp_allo}) + or return undef; + } + $ftp->command($cmd, @_); return 1 |