]> Sergey Matveev's repositories - public-inbox.git/commitdiff
viewvcs: stream_blob_parse_hdr: fix BIN_DETECT retries
authorEric Wong <e@yhbt.net>
Mon, 30 Mar 2020 18:30:09 +0000 (18:30 +0000)
committerEric Wong <e@yhbt.net>
Mon, 30 Mar 2020 18:31:09 +0000 (18:31 +0000)
git-cat-file(1) may return less than the $BIN_DETECT value for
some blobs, so ensure we repopulate the values in $ctx for
retries in that case, otherwise we'll lose `$ctx->{-res}' and
die when attempting to use `undef' as an array ref.

lib/PublicInbox/ViewVCS.pm

index 069937c132af90d6d9fff3c80e55c092e0dc3b49..9ec04f480a09abb628405ec47cfe3a816c54476d 100644 (file)
@@ -58,6 +58,7 @@ sub stream_blob_parse_hdr { # {parse_hdr} for Qspawn
                        warn "premature EOF on $oid $$logref\n";
                        return html_page($ctx, 500, $logref);
                }
+               @$ctx{qw(-res -logref)} = ($res, $logref);
                undef; # bref keeps growing
        }
 }