From: Eric Wong Date: Wed, 25 Oct 2023 00:29:35 +0000 (+0000) Subject: viewvcs: psgi_yield X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0db81747dd0e5627b0d7cc27231cd2b5b389f937;p=thirdparty%2Fpublic-inbox.git viewvcs: psgi_yield Another drop-in replacement, though I took the opportunity to avoid unnecessarily bumping the refcount of $ctx->{env} --- diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 86c46e69e..6c588ddfb 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -101,9 +101,8 @@ sub stream_large_blob ($$) { my ($git, $oid, $type, $size, $di) = @$res; my $cmd = ['git', "--git-dir=$git->{git_dir}", 'cat-file', $type, $oid]; my $qsp = PublicInbox::Qspawn->new($cmd); - my $env = $ctx->{env}; - $env->{'qspawn.wcb'} = $ctx->{-wcb}; - $qsp->psgi_return($env, undef, \&stream_blob_parse_hdr, $ctx); + $ctx->{env}->{'qspawn.wcb'} = $ctx->{-wcb}; + $qsp->psgi_yield($ctx->{env}, undef, \&stream_blob_parse_hdr, $ctx); } sub show_other_result ($$) { # future-proofing @@ -341,7 +340,7 @@ sub show_patch ($$) { my $qsp = PublicInbox::Qspawn->new(\@cmd); $ctx->{env}->{'qspawn.wcb'} = $ctx->{-wcb}; $ctx->{patch_oid} = $oid; - $qsp->psgi_return($ctx->{env}, undef, \&stream_patch_parse_hdr, $ctx); + $qsp->psgi_yield($ctx->{env}, undef, \&stream_patch_parse_hdr, $ctx); } sub show_commit ($$) {