Subject: | LWP 5.808 Bug (or Feature Request) |
Date: | Sun, 27 Jan 2008 19:13:40 -0700 |
To: | <bug-libwww-perl [...] rt.cpan.org> |
From: | Keary Suska <aksuska [...] esoteritech.com> |
I have been having problems with LWP, but having to do with servers with
non-standard chunked transfer encoding--speciically when the content length
line is not provided. Browsers don't seem to have issues with this, and
(IMHO) I think LWP shouldn't either.
I modified Methods.pm to get my installation to work. It's probably kludgey,
and may not work in all instances, but here it is if it helps:
*** /usr/lib/perl5/site_perl/5.8.0/Net/HTTP/Methods.pm.bak 2005-12-07
03:01:37.000000000 -0700
--- /usr/lib/perl5/site_perl/5.8.0/Net/HTTP/Methods.pm 2008-01-27
18:58:34.000000000 -0700
***************
*** 434,440 ****
if !defined($line) || $line ne "";
$line = my_readline($self);
}
! die "EOF when chunk header expected" unless defined($line);
my $chunk_len = $line;
$chunk_len =~ s/;.*//; # ignore potential chunk parameters
unless ($chunk_len =~ /^([\da-fA-F]+)\s*$/) {
--- 434,448 ----
if !defined($line) || $line ne "";
$line = my_readline($self);
}
!
! #die "EOF when chunk header expected" unless defined($line);
! if( ! defined($line) ) {
! delete ${*$self}{'http_chunked'}; # say not chunked
! # read until eof
! $size ||= 8*1024;
! return my_read($self, $$buf_ref, $size);
! }
!
my $chunk_len = $line;
$chunk_len =~ s/;.*//; # ignore potential chunk parameters
unless ($chunk_len =~ /^([\da-fA-F]+)\s*$/) {
Thanks,
Keary Suska
Esoteritech, Inc.