From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7A4C81F59D for ; Fri, 13 Jan 2023 10:35:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673606150; bh=av/riL7ilOiGiMa1snYtpcA8ppUB05G5dBNQK4+GOFI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lnzX9pgF5EhceF37YORJBYc5bWnbUkn+/N0k20ppUmw1QhY7kuxn9KLMsa/jW3CG1 Ud2N2tE4BwbEqPB5HnUwJ0Rfx7FzOKfq/WJn6SVcwmfgPT7G3hUCADV2ehak+a9fIG 9gS+txQ6wEtrUzUAwsKaSkwtsz8JNyYQue5MH3gA= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] qspawn: import Scalar::Util::blessed properly Date: Fri, 13 Jan 2023 10:35:48 +0000 Message-Id: <20230113103550.3020126-2-e@80x24.org> In-Reply-To: <20230113103550.3020126-1-e@80x24.org> References: <20230113103550.3020126-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Scalar::Util may not be loaded by other modules in the future. --- lib/PublicInbox/Qspawn.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm index c2d8fd73..0044c1f6 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); @@ -234,8 +235,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' ?