Skip Menu |

This queue is for tickets about the HTTP-Message CPAN distribution.

Report information
The Basics
Id: 86272
Status: resolved
Priority: 0/
Queue: HTTP-Message

People
Owner: Nobody in particular
Requestors: p.gackiewicz [...] intertele.pl
Cc:
AdminCc:

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



Subject: bug in HTTP::Message::decoded_content()
Date: Thu, 20 Jun 2013 10:17:32 +0200 (CEST)
To: bug-HTTP-Message [...] rt.cpan.org
From: Piotr Gackiewicz <p.gackiewicz [...] intertele.pl>
Hi. I think there is a bug in decoded_content() function in this package. In version 6.06, it evals such piece of code: if ($self->content_is_text || (my $is_xml = $self->content_is_xml)) { my $charset = lc( $opt{charset} || $self->content_type_charset || $opt{default_charset} || $self->content_charset || # <============= "ISO-8859-1" ); ... but content_charset() calls decoded_content() again, creating circular dependency. Evaled code silently dies then. If it is not logical error, this code should be probably rewritten. I found it trying to install CPAN XML::Twig code. It did not pass several tests using LWP::Simple, loading simple HTML via file: url. Simple patch attached, removing this call. Regards, -- Piotr Gackiewicz Intertele S.A. - operator systemów ITL.PL i DOMENY.ITL.PL al. T. Rejtana 10, 35-310 Rzeszów TEL: +48 17 8507580, FAX: +48 17 8520275 http://www.itl.pl - niezawodne serwery wirtualne http://domeny.itl.pl - tanie domeny internetowe http://www.intertele.pl

Message body is not shown because sender requested not to inline it.

I can't see anything wrong with the current code.  The inner call to decoded_content shouid never recurse further as it's called with charset => none.

Can you provide a small test case that demonstrates infinite recursion?  I wasn't able to reproduce any bad behaviour on my own.