]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
viewvcs: psgi_yield
authorEric Wong <e@80x24.org>
Wed, 25 Oct 2023 00:29:35 +0000 (00:29 +0000)
committerEric Wong <e@80x24.org>
Wed, 25 Oct 2023 07:28:38 +0000 (07:28 +0000)
Another drop-in replacement, though I took the opportunity
to avoid unnecessarily bumping the refcount of $ctx->{env}

lib/PublicInbox/ViewVCS.pm

index 86c46e69e2ed305ebdd80e6ae717a7d5d2564010..6c588ddfb603d9d25ad463f2fcf285ed531889d8 100644 (file)
@@ -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 ($$) {