package PublicInbox::Qspawn;
use strict;
-use warnings;
use PublicInbox::Spawn qw(popen_rd);
+use PublicInbox::GzipFilter;
# n.b.: we get EAGAIN with public-inbox-httpd, and EINTR on other PSGI servers
use Errno qw(EAGAIN EINTR);
my ($self) = @_;
my $r = rd_hdr($self) or return;
my $env = $self->{psgi_env};
- my $filter = delete $env->{'qspawn.filter'};
+ my $filter = delete $env->{'qspawn.filter'} //
+ PublicInbox::GzipFilter::qsp_maybe($r->[1], $env);
+
my $wcb = delete $env->{'qspawn.wcb'};
my $async = delete $self->{async};
if (scalar(@$r) == 3) { # error
}
sub setup_rlimit {
- my ($self, $name, $config) = @_;
+ my ($self, $name, $cfg) = @_;
foreach my $rlim (@PublicInbox::Spawn::RLIMITS) {
my $k = lc($rlim);
$k =~ tr/_//d;
$k = "publicinboxlimiter.$name.$k";
- defined(my $v = $config->{$k}) or next;
+ defined(my $v = $cfg->{$k}) or next;
my @rlimit = split(/\s*,\s*/, $v);
if (scalar(@rlimit) == 1) {
push @rlimit, $rlimit[0];