PATCH: multi-line FTP responses
Martin Hamilton (martin@mrrl.lut.ac.uk)
Mon, 08 Jan 1996 14:56:37 +0000
libwww-perl(-5b6) doesn't seem to like FTP servers which produce
multi-line responses - e.g. wu-ftpd. You get the error message
RC_UNAUTHORIZED without WWW-Authenticate
and the FTP session fails :-(
Here's a patch which _seems_ to fix this. It makes the LWP FTP
client keep reading when there's a multi-line response
Cheerio,
Martin
*** /home/martin/libwww-perl-5b6/lib/LWP/Protocol/ftp.pm Mon Nov 6 10:07:25 1995
--- /usr/local/lib/perl5/LWP/Protocol/ftp.pm Mon Jan 8 14:46:27 1996
***************
*** 264,271 ****
{
my($sock, $digit, $dont_die) = @_;
my $response;
! $sock->readUntil("\r?\n", \$response, undef);
! my($code, $string) = $response =~ m/^(\d+)\s+(.*)/;
die "$response\n" if substr($code,0,1) ne $digit && !$dont_die;
LWP::Debug::debug($response);
$response;
--- 264,276 ----
{
my($sock, $digit, $dont_die) = @_;
my $response;
! my($code, $continuation, $string);
!
! while (1) {
! $sock->readUntil("\r?\n", \$response, undef);
! ($code, $continuation, $string) = $response =~ m/^(\d+)(.)(.*)/;
! last if $continuation eq " ";
! }
die "$response\n" if substr($code,0,1) ne $digit && !$dont_die;
LWP::Debug::debug($response);
$response;