Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 40985
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: ruff [...] ukrpost.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 5.820
Fixed in: (no value)



Subject: LWP::Protocol::collect error handling
In LWP::Protocol::collect method operator || used for error handling, which causing 'die' case if $_[3] is '0'. Need to replace with 'or' operator, which has lesser precedence. --- Protocol.pm 2008-11-17 02:50:48.000000000 -0600 +++ /usr/local/share/perl/5.8.4/LWP/Protocol.pm 2008-11-17 02:35:09.000000000 -0600 @@ -101,17 +101,17 @@ $response->{default_add_content} = 1; } elsif (!ref($arg) && length($arg)) { - open(my $fh, ">", $arg) || die "Can't write to '$arg': $!"; + open(my $fh, ">", $arg) or die "Can't write to '$arg': $!"; binmode($fh); push(@{$response->{handlers}{response_data}}, { callback => sub { - print $fh $_[3] || die "Can't write to '$arg': $!"; + print $fh $_[3] or die "Can't write to '$arg': $!"; 1; }, }); push(@{$response->{handlers}{response_done}}, { callback => sub { - close($fh) || die "Can't write to '$arg': $!"; + close($fh) or die "Can't write to '$arg': $!"; undef($fh); }, });
Thanks! Applied. http://gitorious.org/projects/libwww- perl/repos/mainline/commits/3bc5c50fbe10124026749144bcc851e975207268