Subject: | IO::Uncompress::Gunzip errors when reading from Net::FTP data socket |
We are getting errors when using an IO::Uncompress::Gunzip object that
is reading from an FTP data connection socket.
my $in_fh = $ftp->retr($filename);
my $gz = IO::Uncompress::Gunzip->new($in_fh);
print $out_fh $buffer while $gz->read($buffer, 1000) > 0;
Timeout at /dp/usr/imb/perl/lib/IO/Uncompress/Base.pm line 67
When using Compress::Zlib, we get "data error" errors when doing gzread.
We didn't have any trouble reading directly from the socket with
Compress::Zlib 1.x.
my $gz = gzopen($in_fh, 'rb') or die "Can't gzopen: $gzerrno";
my $buffer;
while (my $size = $gz->gzread($buffer)) {
die "Read error: $gzerrno\n" if $size < 0;
print $out_fh $buffer;
}
This is on RHEL 4, with locally-built Perl 5.8.8, and Net::FTP 2.75.