Subject: | [PATCH] cumulative patch for bugs #42112 #43847 #42703 #41673 #45491 |
Date: | Sun, 10 May 2009 22:33:43 +0200 |
To: | bug-WWW-Mechanize [...] rt.cpan.org |
From: | kmx <kmx [...] volny.cz> |
Message body not shown because it is not plain text.
diff -u -r WWW-Mechanize-1.54/lib/WWW/Mechanize.pm WWW-Mechanize-1.54_01/lib/WWW/Mechanize.pm
--- WWW-Mechanize-1.54/lib/WWW/Mechanize.pm 2009-01-12 06:40:28.000000000 +0100
+++ WWW-Mechanize-1.54_01/lib/WWW/Mechanize.pm 2009-05-10 21:51:25.718750000 +0200
@@ -10,7 +10,7 @@
=cut
-our $VERSION = '1.54';
+our $VERSION = '1.54_01';
=head1 SYNOPSIS
@@ -219,6 +219,7 @@
quiet => 0,
stack_depth => 8675309, # Arbitrarily humongous stack
headers => {},
+ noproxy => 0,
);
my %passed_parms = @_;
@@ -241,7 +242,7 @@
$self->{$parm} = $mech_parms{$parm};
}
$self->{page_stack} = [];
- $self->env_proxy() unless $parent_parms{noproxy};
+ $self->env_proxy() unless $mech_parms{noproxy};
# libwww-perl 5.800 (and before, I assume) has a problem where
# $ua->{proxy} can be undef and clone() doesn't handle it.
diff -u -r WWW-Mechanize-1.54/t/cookies.t WWW-Mechanize-1.54_01/t/cookies.t
--- WWW-Mechanize-1.54/t/cookies.t 2009-01-12 06:37:38.000000000 +0100
+++ WWW-Mechanize-1.54_01/t/cookies.t 2009-05-10 22:01:47.687500000 +0200
@@ -49,8 +49,8 @@
$cgi->end_html;
}
-# start the server on port 8080
-my $server = TestServer->new();
+# start the server on a random port between 50000-59999
+my $server = TestServer->new(50000 + int(rand(9999)));
$server->set_dispatch( {
'/feedme' => \&send_cookies,
'/nocookie' => \&nosend_cookies,
@@ -61,7 +61,7 @@
my $cookiepage_url = "http://127.0.0.1:$port/feedme";
my $nocookiepage_url = "http://127.0.0.1:$port/nocookie";
-my $mech = WWW::Mechanize->new( autocheck => 0 );
+my $mech = WWW::Mechanize->new( autocheck => 0, noproxy => 1 );
isa_ok( $mech, 'WWW::Mechanize' );
FIRST_COOKIE: {
@@ -112,7 +112,7 @@
}
-my $nprocesses = kill 15, $pid;
+my $nprocesses = kill KILL => $pid;
is( $nprocesses, 1, 'Signaled the child process' );
Hi,
please find enclosed simple patch against WWW::Mechanize v1.54 (as well
as the whole patched package). The patch solves the following issues:
#41673 Using hardcoded port in t/cookies.t
- now we choose a random port from range 50000-59999
#43847 Cookie tests fail in proxy environment (also #42703)
- fixed via noproxy option
#45491 noproxy option throws off LWP::UserAgent
- the patch proposed in bugreport applied
#42112 Cookie test hangs forever on Win32
- "kill 9" is not enough on Win32 - now we send "kill 15"
The patch itself is not as huge as the list of bugs it solves.
Sorry for creating a new bug in fact duplicating 5 others; however their
solution was so close that I decided for this way.
--
kmx