diff options
author | Eric Wong <e@80x24.org> | 2016-03-12 03:55:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-03-12 03:55:20 +0000 |
commit | 7dd78012da81d48e5e73e56c3255895dfa9de1f5 (patch) | |
tree | 1a166dbbc624f14c946237c66ceb861424ed7b29 | |
parent | dca2724e0aebc5832a0c88ec944a925daf21b9be (diff) | |
download | public-inbox-7dd78012da81d48e5e73e56c3255895dfa9de1f5.tar.gz |
This allows us to reduce installation dependencies while retaining performance as it favors HTTP::Parser::XS when it is installed and available. PLACK_HTTP_PARSER_PP may be set to 1 to force a pure Perl parser for testing.
-rw-r--r-- | lib/PublicInbox/HTTP.pm | 2 | ||||
-rw-r--r-- | t/httpd-corner.t | 2 | ||||
-rw-r--r-- | t/httpd-unix.t | 2 | ||||
-rw-r--r-- | t/httpd.t | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 28883114..a5c56e25 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -13,7 +13,7 @@ use warnings; use base qw(Danga::Socket); use fields qw(httpd env rbuf input_left remote_addr remote_port); use Fcntl qw(:seek); -use HTTP::Parser::XS qw(parse_http_request); # supports pure Perl fallback +use Plack::HTTPParser qw(parse_http_request); # XS or pure Perl use HTTP::Status qw(status_message); use HTTP::Date qw(time2str); use IO::File; diff --git a/t/httpd-corner.t b/t/httpd-corner.t index 59f37aa9..b64f334a 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -7,7 +7,7 @@ use warnings; use Test::More; foreach my $mod (qw(Plack::Util Plack::Request Plack::Builder Danga::Socket - HTTP::Parser::XS HTTP::Date HTTP::Status)) { + HTTP::Date HTTP::Status)) { eval "require $mod"; plan skip_all => "$mod missing for httpd-corner.t" if $@; } diff --git a/t/httpd-unix.t b/t/httpd-unix.t index 13df676b..00adf13c 100644 --- a/t/httpd-unix.t +++ b/t/httpd-unix.t @@ -6,7 +6,7 @@ use warnings; use Test::More; foreach my $mod (qw(Plack::Util Plack::Request Plack::Builder Danga::Socket - HTTP::Parser::XS HTTP::Date HTTP::Status)) { + HTTP::Date HTTP::Status)) { eval "require $mod"; plan skip_all => "$mod missing for httpd-unix.t" if $@; } @@ -5,7 +5,7 @@ use warnings; use Test::More; foreach my $mod (qw(Plack::Util Plack::Request Plack::Builder Danga::Socket - HTTP::Parser::XS HTTP::Date HTTP::Status)) { + HTTP::Date HTTP::Status)) { eval "require $mod"; plan skip_all => "$mod missing for httpd.t" if $@; } |