]> Sergey Matveev's repositories - public-inbox.git/commitdiff
viewvcs: keep temporary Solver dir for large streams
authorEric Wong <e@80x24.org>
Sun, 26 May 2019 08:24:46 +0000 (08:24 +0000)
committerEric Wong <e@80x24.org>
Sun, 26 May 2019 08:25:19 +0000 (08:25 +0000)
Streaming large blobs can take multiple iterations of the event
loop in our -httpd; so we must not let the File::Temp::Dir
result go out-of-scope when streaming large blobs created from
patches.

lib/PublicInbox/ViewVCS.pm

index 962dc66baccd708ca34666939a6ad306c5ad78a4..60a62e577ab731050dfbcabcdae6c17cda093bb0 100644 (file)
@@ -48,6 +48,7 @@ sub stream_large_blob ($$$$) {
        my $qsp = PublicInbox::Qspawn->new($cmd);
        my @cl = ('Content-Length', $size);
        my $env = $ctx->{env};
+       $env->{'public-inbox.tmpgit'} = $git; # for {-tmp}/File::Temp::Dir
        $env->{'qspawn.wcb'} = delete $ctx->{-wcb};
        $qsp->psgi_return($env, undef, sub {
                my ($r, $bref) = @_;