From db30d5997b004505e16e1cdcd964479a5229e307 Mon Sep 17 00:00:00 2001 From: Tom Callaway <s...@fedoraproject.org> Date: Mon, 15 Jun 2015 11:32:09 -0400 Subject: fix issue with via handling (cpan 105177) & fix test failure in 23connect by checking for socket blocking mode (bz 1231244)
diff --git a/HTTP-Proxy-0.303-fix-23connect-to-check-socket-blocking-mode.patch b/HTTP-Proxy-0.303-fix-23connect-to-check-socket-blocking-mode.patch new file mode 100644 index 0000000..a155989 --- /dev/null +++ b/HTTP-Proxy-0.303-fix-23connect-to-check-socket-blocking-mode.patch @@ -0,0 +1,41 @@ +diff -up HTTP-Proxy-0.303/t/23connect.t.fixme HTTP-Proxy-0.303/t/23connect.t +--- HTTP-Proxy-0.303/t/23connect.t.fixme 2015-06-15 11:27:28.791145387 -0400 ++++ HTTP-Proxy-0.303/t/23connect.t 2015-06-15 11:29:15.167490896 -0400 +@@ -32,7 +32,6 @@ my $banner = "President_of_Earth Barbare + if ( !$pid ) { + my $sock = $server->accept; + $sock->print($banner); +- sleep 2; + $sock->close; + exit; + } +@@ -53,9 +52,6 @@ plan tests => 4; + } + ); + +- # wait for the server and proxy to be ready +- sleep 2; +- + # run a client + my $ua = LWP::UserAgent->new; + $ua->proxy( http => $proxy->url ); +@@ -64,6 +60,10 @@ plan tests => 4; + my $res = $ua->request($req); + my $sock = $res->{client_socket}; + ++ if ( !$sock->blocking ) { ++ diag("socket is non blocking, switching to blocking mode"); ++ $sock->blocking(1); ++ } + + # what does the proxy say? + is( $res->code, 200, "The proxy accepts CONNECT requests" ); +@@ -75,7 +75,7 @@ plan tests => 4; + alarm 30; + $read = <$sock>; + }; +- ++ + ok( $read, "Read some data from the socket" ); + is( $read, $banner, "CONNECTed to the TCP server and got the banner" ); + close $sock; diff --git a/HTTP-Proxy-0.303-fix-via.patch b/HTTP-Proxy-0.303-fix-via.patch new file mode 100644 index 0000000..e08e378 --- /dev/null +++ b/HTTP-Proxy-0.303-fix-via.patch @@ -0,0 +1,35 @@ +diff -up HTTP-Proxy-0.303/lib/HTTP/Proxy.pm.fixvia HTTP-Proxy-0.303/lib/HTTP/Proxy.pm +--- HTTP-Proxy-0.303/lib/HTTP/Proxy.pm.fixvia 2015-06-15 11:20:21.378357137 -0400 ++++ HTTP-Proxy-0.303/lib/HTTP/Proxy.pm 2015-06-15 11:20:40.378389429 -0400 +@@ -90,6 +90,7 @@ sub new { + port => 8080, + stash => {}, + timeout => 60, ++ via => undef, + x_forwarded_for => 1, + ); + +diff -up HTTP-Proxy-0.303/t/15accessors.t.fixvia HTTP-Proxy-0.303/t/15accessors.t +--- HTTP-Proxy-0.303/t/15accessors.t.fixvia 2015-06-15 11:22:14.585078744 -0400 ++++ HTTP-Proxy-0.303/t/15accessors.t 2015-06-15 11:22:19.137043946 -0400 +@@ -28,7 +28,7 @@ my %meth = ( + # loop is not used/internal for now + ); + +-plan tests => 15 + keys %meth; ++plan tests => 16 + keys %meth; + + for my $key ( sort keys %meth ) { + no strict 'refs'; +@@ -38,6 +38,11 @@ for my $key ( sort keys %meth ) { + like( $proxy->via(), qr!\(HTTP::Proxy/$HTTP::Proxy::VERSION\)$!, + "via has the correct default"); + ++{ ++ my $my_via_proxy = HTTP::Proxy->new( via => 'VIA!VIA!VIA!' ); ++ is( $my_via_proxy->via(), 'VIA!VIA!VIA!', 'custom via' ); ++} ++ + # test deprecated accessors + $proxy = HTTP::Proxy->new( maxserve => 127, maxconn => 255 ); + is( $proxy->max_keep_alive_requests, 127, "deprecated maxserve"); diff --git a/perl-HTTP-Proxy.spec b/perl-HTTP-Proxy.spec index ad90b18..dedde5c 100644 --- a/perl-HTTP-Proxy.spec +++ b/perl-HTTP-Proxy.spec @@ -2,12 +2,16 @@ Name: perl-HTTP-Proxy Version: 0.303 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A pure Perl HTTP proxy Group: Development/Libraries License: GPL+ or Artistic URL: http://search.cpan.org/dist/HTTP-Proxy/ Source0: http://www.cpan.org/authors/id/B/BO/BOOK/HTTP-Proxy-%{version}.tar.gz +# https://rt.cpan.org/Public/Bug/Display.html?id=105177 +Patch0: HTTP-Proxy-0.303-fix-via.patch +# https://github.com/book/HTTP-Proxy/commit/e6e9f75a9aa28b121fd9ee5e4f604516908f81b2 +Patch1: HTTP-Proxy-0.303-fix-23connect-to-check-socket-blocking-mode.patch BuildArch: noarch BuildRequires: perl BuildRequires: perl(Module::Build), perl(Module::Build::Tiny) @@ -33,6 +37,8 @@ an origin server. %prep %setup -q -n HTTP-Proxy-%{version} +%patch0 -p1 -b .fixvia +%patch1 -p1 -b .socketfix %build %{__perl} Makefile.PL INSTALLDIRS=vendor @@ -53,6 +59,10 @@ make test %{_mandir}/man3/*.3pm* %changelog +* Mon Jun 15 2015 Tom Callaway <s...@fedoraproject.org> - 0.303-3 +- fix issue with via handling (cpan 105177) +- fix test failure in 23connect by checking for socket blocking mode (bz 1231244) + * Sat Jun 06 2015 Jitka Plesnikova <jples...@redhat.com> - 0.303-2 - Perl 5.22 rebuild -- cgit v0.10.2 http://pkgs.fedoraproject.org/cgit/perl-HTTP-Proxy.git/commit/?h=master&id=db30d5997b004505e16e1cdcd964479a5229e307 -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/perl-devel