Subject: | Not a bug but a workaround to a server bug. |
Date: | Fri, 15 Jan 2010 09:20:11 -0600 |
To: | bug-NET-FTPSSL [...] rt.cpan.org |
From: | Ben Webb <webb [...] cargotel.com> |
Curtis,
I would have just emailed you directly but you have your email squashed on
CPAN. A server I'm having to communicate with breaks if you send it an ALLO
command, so I added an option to disable the allo. My diff follows. I
don't know if this is something you want to include or not, but for at least
one person it was necessary.
Thanks for providing a good module.
--
Ben Webb
CargoTel
ph: 866-227-4683 x719
YIM: benrwebb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -74,6 +74,7 @@
my $data_prot = ($encrypt_mode eq CLR_CRYPT) ? DATA_PROT_CLEAR
: ($arg->{DataProtLevel} ||
DATA_PROT_PRIVATE);
my $use_ssl = $arg->{useSSL} || 0;
+ my $squash_allo = $arg->{squashALLO} || 0;
my $die = $arg->{Croak} || $arg->{Die};
my $pres_ts = $arg->{PreserveTimestamp} || 0;
my $use_logfile = $debug && (defined $arg->{DebugLogFile} &&
@@ -189,15 +190,16 @@
}
# These options control the behaviour of the Net::FTPSSL class ...
- ${*$obj}{Crypt} = $encrypt_mode;
- ${*$obj}{debug} = $debug;
- ${*$obj}{trace} = $trace;
- ${*$obj}{timeout} = $timeout;
- ${*$obj}{buf_size} = $buf_size;
- ${*$obj}{type} = MODE_ASCII;
- ${*$obj}{data_prot} = $data_prot;
- ${*$obj}{Croak} = $die;
- ${*$obj}{FixPutTs} = ${*$obj}{FixGetTs} = $pres_ts;
+ ${*$obj}{Crypt} = $encrypt_mode;
+ ${*$obj}{debug} = $debug;
+ ${*$obj}{trace} = $trace;
+ ${*$obj}{timeout} = $timeout;
+ ${*$obj}{buf_size} = $buf_size;
+ ${*$obj}{type} = MODE_ASCII;
+ ${*$obj}{data_prot} = $data_prot;
+ ${*$obj}{squash_allo} = $squash_allo;
+ ${*$obj}{Croak} = $die;
+ ${*$obj}{FixPutTs} = ${*$obj}{FixGetTs} = $pres_ts;
${*$obj}{ftpssl_filehandle} = $FTPS_ERROR if ( $debug == 2 );
$FTPS_ERROR = undef;
@@ -814,8 +816,8 @@
return undef; # Already decided not to call croak if you get here!
}
- # If alloc_size is already set, I skip this part
- unless ( defined ${*$self}{alloc_size} ) {
+ # If alloc_size is already set or we squash allo, I skip this part
+ unless ( defined ${*$self}{alloc_size} || ${*$self}{squash_allo} ) {
if ( $close_file && -f $file_loc ) {
my $size = -s $file_loc;
$self->alloc($size);