X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FQspawn.pm;h=779b703a0f270cf81196279c7f616a6b7c7283ac;hb=a1ee3e0d84fedc4a2dd4e16e7054ee6fdfbe111a;hp=c2d8fd732c7a0ddf6696f7bd6316e0536dc0776f;hpb=769980473c998566c038744a72804e4d38d2b8cc;p=public-inbox.git diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm index c2d8fd73..779b703a 100644 --- a/lib/PublicInbox/Qspawn.pm +++ b/lib/PublicInbox/Qspawn.pm @@ -28,6 +28,7 @@ package PublicInbox::Qspawn; use v5.12; use PublicInbox::Spawn qw(popen_rd); use PublicInbox::GzipFilter; +use Scalar::Util qw(blessed); # n.b.: we get EAGAIN with public-inbox-httpd, and EINTR on other PSGI servers use Errno qw(EAGAIN EINTR); @@ -211,7 +212,6 @@ sub rd_hdr ($) { $ret = [ 500, [], [ "Internal error\n" ] ]; } elsif (!defined($ret) && !$r) { my $cmd = $self->{cmd} // [ '(?)' ]; - my $env = $self->{psgi_env}; warn <{psgi_env}->{REQUEST_URI}) EOM @@ -234,8 +234,9 @@ sub psgi_return_init_cb { # this may be PublicInbox::HTTPD::Async {cb} my $r = rd_hdr($self) or return; my $env = $self->{psgi_env}; my $filter; - if (ref($r) eq 'ARRAY' && Scalar::Util::blessed($r->[2]) && - $r->[2]->can('attach')) { + + # this is for RepoAtom since that can fire after parse_cgi_headers + if (ref($r) eq 'ARRAY' && blessed($r->[2]) && $r->[2]->can('attach')) { $filter = pop @$r; } $filter //= delete($env->{'qspawn.filter'}) // (ref($r) eq 'ARRAY' ?