Bug#591462: libwww-perl: redo; outside the scope of the module (LWP/Protocol/http.pm)
Jérémy Ruffet
sativouf at gmail.com
Tue Aug 3 10:39:33 UTC 2010
Package: libwww-perl
Version: 5.813-1
Severity: normal
Tags: patch
Here is how to reproduce :
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use Switch;
my $browser = LWP::UserAgent->new();
sub called_once {
my $url = "http://www.lighttpd.net/" . "/"x2**16;
print STDERR "1\n";
my $res = $browser->get($url);
print STDERR "2\n";
}
my $arg = "bug";
switch($arg) {
case "bug" {
&called_once;
}
}
Here is how it is corrected in squeeze's libwww-perl :
--- http-lenny.pm 2010-08-03 12:08:02.562469636 +0200
+++ http-as-in-squeeze.pm 2010-08-03 12:11:56.218409712 +0200
@@ -203,15 +203,16 @@
#print "------\n$req_buf\n------\n";
if (!$has_content || $write_wait || $has_content > 8*1024) {
- do {
+ WRITE:
+ {
# Since this just writes out the header block it should almost
# always succeed to send the whole buffer in a single write call.
my $n = $socket->syswrite($req_buf, length($req_buf));
unless (defined $n) {
- redo if $!{EINTR};
+ redo WRITE if $!{EINTR};
if ($!{EAGAIN}) {
select(undef, undef, undef, 0.1);
- redo;
+ redo WRITE;
}
die "write failed: $!";
}
@@ -221,8 +222,8 @@
else {
select(undef, undef, undef, 0.5);
}
+ redo WRITE if length $req_buf;
}
- while (length $req_buf);
}
my($code, $mess, @junk);
-- System Information:
Debian Release: 5.0.4
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.32.15-grsec-vs (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libwww-perl depends on:
ii libhtml-parser-perl 3.56-1+lenny1 A collection of modules that parse
ii libhtml-tagset-perl 3.20-2 Data tables pertaining to HTML
ii libhtml-tree-perl 3.23-1 represent and create HTML syntax t
ii liburi-perl 1.35.dfsg.1-1 Manipulates and accesses URI strin
ii netbase 4.34 Basic TCP/IP networking system
ii perl [libdigest-md5-perl 5.10.0-19lenny2 Larry Wall's Practical Extraction
Versions of packages libwww-perl recommends:
ii libcompress-zlib-perl 2.012-1 Perl module for creation and manip
ii libhtml-format-perl 2.04-2 format HTML syntax trees into text
ii libmailtools-perl 2.03-1 Manipulate email in perl programs
Versions of packages libwww-perl suggests:
ii libio-socket-ssl-perl 1.16-1+lenny1 Perl module implementing object or
-- no debconf information
More information about the pkg-perl-maintainers
mailing list