Subject: | LWP head() versus tuxfamily pureftpd |
Date: | Wed, 28 Oct 2009 11:35:05 +1100 |
To: | bug-libwww-perl [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With recent debian libwww-perl 5.833 and perl 5.10.1, the program foo.pl
below prints
not success
500 FTP close response: 500 File successfully transferred
0.000 seconds (measured here), 1.29 Mbytes per second
Unknown command
Server: --------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Content-Type: application/pgp-signature
Last-Modified: Thu, 02 Jul 2009 21:52:18 GMT
Client-Date: Wed, 28 Oct 2009 00:27:38 GMT
Client-Request-Num: 1
where I hoped it would be some success response, since the file exists,
and an LWP get() on it succeeds.
The affected url is one of my files at tuxfamily, just a little gnupg
ascii armoured sig
ftp://download.tuxfamily.org/user42/align-let.el.asc
I suspect it's something to do with aborting the transfer. I've heard
not all servers take kindly to that. Dunno if the blame for treating it
as failed belongs to Net::FTP or to something under LWP. Perhaps the
"500 File successfully transferred" could be recognised as success,
wherever it comes from.
use strict;
use warnings;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $resp = $ua->head ('ftp://download.tuxfamily.org/user42/align-let.el.asc');
print $resp->is_success ? "success\n\n" : "not success\n\n";
print $resp->as_string;