Hi Fabian,
Thank you for writing. I'm always interested in hearing feedback about my module.
Your main issue seems to be a time out issue with my module. And that happened to be the major focus of my last release. Before v0.24, the Timeout option really didn't do anything. The underlying code my class inherited from said it did something with it, but it turned out it really ignored the flag as far as I could tell. So I finally had to implement a timeout myself to fix another issue using the existing Timeout option.
So have you tried increasing "Timeout => 20" to something larger to see if it fixed your issue? The Timeout values defaults to 120.
A better test script would have been:
$site = Net::FTPSSL->new("<IP>", Port => <PORT>, Croak => 1, Debug=>1, DebugLogFile => "myLog.txt")
$site->login("<USERNAME>", "<PASSWORD>");
$site->quit();
The "Croak" option handles the "or die" for you. So you don't have to put that into your code. I also left off Timeout on purpose.
With this test script you could have sent me the entire log file "myLog.txt" as an attachment instead of mixing it in with your problem description. Making it much easier to read & figure out your problem.
Could you rerun the test with v0.24 again & send me the "myLog.txt" log file?
Now onto Section # 2. There was a bug in your test script, which was why last_message() returned the message for "help" instead of "feat". There was a reason I didn't document command(), which you used incorrectly. You could have gotten the results you wanted by calling $site->quot("feat");, which was documented. Try: perldoc Net::FTPSSL for the built in documentation on this module. It documents every method that is safe to use & details the available options to "new()". You have to assume any method or option not documented I feel safe to change between releases.
Next, did increasing the buffer size from 4096 to 8192 fix your problem? If it did, I'm assuming you just hid it until something even bigger comes along.
So can I have a login on your FTP server to test out some code? I'll give you my personal email so you can avoid posting the information if you can.
As to the warnings, I'll look into it. Your patch gave me ideas on how to fix it. But a separate log file will help me confirm it.
As for the status code being split between two lines, that is the behavior of your server. I've run into that issue before and I think my code handles it quite well. I'm very leery of modifying the response to put it back on one line since that will tend to hide issues in future tickets. But again a log file generated as an attachment will help me confirm this or if its a similar type of problem I'm not handling.
Once I get your full log file, if I can't test against your server I can send you a beta of the next release to see if it helps any. It has a couple of new features to help with reporting on issues that I'm still trying to work out. But I'll want to take a stab at fixing the warning issue before I give out a new beta.
I'm looking forward to hearing back from you.
Curtis
On Tue Jul 29 18:52:18 2014, kallmeie@fim.uni-passau.de wrote:
Show quoted text> Hey there,
>
> first of all. I want to thank you for all your work. I already use
> this
> module for a long time and I really appretiate it!
>
> Recently, I ran into two issues. First of all, some details to my
> system:
>
> OS: Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u1 x86_64 GNU/Linux
> Perl: This is perl 5, version 14, subversion 2 (v5.14.2) built for
> x86_64-linux-gnu-thread-multi
> Module: Net::FTPSSL v0.24
>
> *1. issue:*
>
> Since the update from 0.23 to 0.24, I cannot connect to one of my ftp
> servers any more. The daemon is drftpd. When I turn on debug mode, It
> stopps while printing the welcome message. (which is pretty long) I
> initialize the object like this:
>
> $site = Net::FTPSSL->new("<IP>", Port => <PORT>, Timeout => 20, Croak => 1)
> or die $Net::FTPSSL::ERRSTR;
> $site->login("<USERNAME>", "<PASSWORD>")
> or die $Net::FTPSSL::ERRSTR;
>
> The script quits with the error:
>
> Timed out waiting for a response!
> at test.pl line 24
>
> Line 24 is the line where I try to login to the server, not where I
> initialize the object.
>
> <<+ 214 The HELP command is supported.
> 214 The HELP command is supported.
>
> As you can see, there are several things that go wrong here.
>
> 1. Same problem as with the drftpd, the long welcome message is split
> in
> the middle of some lines.
> 2. Sometimes, there is just the first digit of the response code or
> the
> first character of some commands in one line (2 of 211, A of ABORT, M
> of
> Mode, R of RNTO, ...)
> 3. There are empty lines in the "feat"-command, if I am right, thats
> why
> there is the error message "Use of uninitialized value ..."
> 4. print $site->last_message () in my script should print the response
> of the "feat"-command, instead, it just prints the last line ("214 The
> HELP command is supported.")
>
> I also tried to solve theese problems on my own. Here is a diff of the
> latest module version and my changes:
>
> 2398a2399,2400
> > next if ( $line eq "" );
> >
> 2627c2629,2630
> < my $read = sysread( $self, $data, 4096);
> ---
> > # my $read = sysread( $self, $data, 4096);
> > my $read = sysread( $self, $data, 8196);
> 2662a2666,2667
> > my $addCR = 1;
> >
> 2667a2673
> > $addCR = 0 if (length ($code) < 3 && $sep eq "" and $desc
> eq "");
> 2681d2686
> <
> 2686c2691,2693
> < ${*$self}{last_ftp_msg} .= "\n"; # Restore the
> internal <CR>.
> ---
> > if ($addCR == 1) {
> > ${*$self}{last_ftp_msg} .= "\n"; # Restore the
> internal <CR>.
> > }
>
> 2398a2399,2400 <-- The "Use of uninitialized value ..." errors where
> gone, because empty lines are ignored
> 2627c2629,2630 <-- Increasing the length value
>
> All other changes solved the issue, that some responses with a
> response
> code where split after the first digit, not for the debug messages but
> for the output of $site->last_message ().
>
> As I could see, the subroutine response has a lot of special cases
> because the differend ftpds seem to handle the responses differently.
> I
> don't know if you are interested in supporting another ftp daemon. If
> I'm right, my changes just affected lines which were added to fix the
> bug # 73115 so hopefully, they don't effect other ftp daemons. If you
> don't want to add more special cases, perhaps you could check if your
> test cases still work with my changes?
>
> Many thanks in advance for reading this, I hope this mail is not a
> complete mess :-) If you have any questions, need more details, more
> debug outputs or something else, don't hesitate to ask!
>
> Best wishes
>
> Fabian Kallmeier