Subject: | FTP range request size off by one in LWP::Protocol::ftp |
The size calculation for FTP range requests is off by one.
The 2nd number in the HTTP Request header is the index of the last byte
requested, not the index of the first byte not requested.
Thus, in LWP/Protocol/ftp.pm
$max_size = $end_byte - $start_byte;
should be
$max_size = $end_byte - $start_byte + 1;
Compare:
perl -lMLWP::UserAgent '-eprint
LWP::UserAgent->new()->get("http://cpan.org/src/README",Range=>"bytes=0-3")->content'
perl -lMLWP::UserAgent '-eprint
LWP::UserAgent->new()->get("ftp://cpan.org/src/README",Range=>"bytes=0-3")->content'