Package: squid-prefetch Version: 1.0-1 Severity: normal Tags: patch Hi,
Attached is the diff for my squid-prefetch 1.0-1.1 NMU.
diff -Nru /tmp/A7XIT6TkIo/squid-prefetch-1.0/debian/changelog /tmp/3EOq683wfD/squid-prefetch-1.0/debian/changelog --- /tmp/A7XIT6TkIo/squid-prefetch-1.0/debian/changelog 2005-01-04 15:39:54.000000000 +0100 +++ /tmp/3EOq683wfD/squid-prefetch-1.0/debian/changelog 2006-06-03 21:31:34.000000000 +0200 @@ -1,3 +1,11 @@ +squid-prefetch (1.0-1.1) unstable; urgency=high + + * Non-maintainer upload. + * Fix alarm timer handling in case of exceptions; patch from Matej Vela. + (Closes: #349745) + + -- Steinar H. Gunderson <[EMAIL PROTECTED]> Sat, 3 Jun 2006 21:30:07 +0200 + squid-prefetch (1.0-1) unstable; urgency=medium * fixed problem locating squid config file (closes: #267737) diff -Nru /tmp/A7XIT6TkIo/squid-prefetch-1.0/squid-prefetch /tmp/3EOq683wfD/squid-prefetch-1.0/squid-prefetch --- /tmp/A7XIT6TkIo/squid-prefetch-1.0/squid-prefetch 2005-01-04 15:39:10.000000000 +0100 +++ /tmp/3EOq683wfD/squid-prefetch-1.0/squid-prefetch 2006-06-03 21:30:05.000000000 +0200 @@ -144,14 +144,18 @@ local $SIG{ALRM} = sub { die "Error: Timeout fetching $url\n" }; alarm(3); + eval { my $http = Net::HTTP->new(PeerHost => $ProxyHost, PeerPort => $ProxyPort, Host => $host, SendTE => 0, KeepAlive => 0); $http->write_request("GET" => "http://$host$path", "Accept" => "text/html", "Cache-Control" => "only-if-cached", "User-Agent" => "Squid-Prefetch"); my ($code,$mesg,%hdrs) = $http->read_response_headers(); print "\nfetch: $url: $code ($mesg)\n"; print " $k -> $v\n" while (($k,$v) = each %hdrs); + }; alarm(0); + die if $@; + if ($code != 200) { print STDERR "Warning: fetch returned code $code ($mesg) for $url\n"; return; @@ -170,6 +174,7 @@ } alarm(5); + eval { while (1) { my $bufr; my $size = $http->read_entity_body($bufr,4096); @@ -193,7 +198,9 @@ $data =~ s!^.*($|<)!!; } + }; alarm(0); + die if $@; @links = uniq(sort(@links)); RandomizeArray([EMAIL PROTECTED]); @@ -216,14 +223,18 @@ local $SIG{ALRM} = sub { die "Error: Timeout fetching $url\n" }; alarm(3); + eval { my $http = Net::HTTP->new(PeerHost => $ProxyHost, PeerPort => $ProxyPort, Host => $host, SendTE => 1, KeepAlive => 0); $http->write_request("GET" => "http://$host$path", "Accept" => "text/*", "User-Agent" => "Squid-Prefetch"); my ($code,$mesg,%hdrs) = $http->read_response_headers(); print "\nprefetch: $url: $code ($mesg)\n"; # print " $k -> $v\n" while (($k,$v) = each %hdrs); + }; alarm(0); + die if $@; + if ($code != 200) { print STDERR "Warning: fetch returned code $code ($mesg) for $url\n"; return; @@ -238,6 +249,7 @@ } alarm(5); + eval { while (1) { my $bufr; my $size = $http->read_entity_body($bufr,4096); @@ -246,7 +258,9 @@ $total += $size; last if ($total > $FetchMaxSize); } + }; alarm(0); + die if $@; }