From 65ff86f333a1f8276943248efef7fa2a64afe9e3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 25 Feb 2016 03:10:51 +0000 Subject: www: make interface more OO This allows multiple instances the WWW app from running within the same process space --- public-inbox.cgi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'public-inbox.cgi') diff --git a/public-inbox.cgi b/public-inbox.cgi index e73e23ca..ee9510c1 100755 --- a/public-inbox.cgi +++ b/public-inbox.cgi @@ -11,7 +11,7 @@ use Plack::Request; use Plack::Handler::CGI; use PublicInbox::WWW; BEGIN { PublicInbox::WWW->preload if $ENV{MOD_PERL} } - +my $www = PublicInbox::WWW->new; my $have_deflater = eval { require Plack::Middleware::Deflater; 1 }; my $app = builder { if ($have_deflater) { @@ -27,9 +27,6 @@ my $app = builder { # enable 'ReverseProxy'; enable 'Head'; - sub { - my $req = Plack::Request->new(@_); - PublicInbox::WWW::run($req, $req->method); - } + sub { $www->call(@_) }; }; Plack::Handler::CGI->new->run($app); -- cgit v1.2.3-24-ge0c7