]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
www: quiet errors for git-{archive,http-backend}
authorEric Wong <e@80x24.org>
Fri, 9 Feb 2024 17:37:05 +0000 (17:37 +0000)
committerEric Wong <e@80x24.org>
Sat, 10 Feb 2024 04:17:20 +0000 (04:17 +0000)
SIGPIPE (13) can be quite common with unreliable connections
and impatient clients, so just ignore them.

lib/PublicInbox/GitHTTPBackend.pm
lib/PublicInbox/RepoSnapshot.pm

index 7228555b87b68b6206a0be962569d4b252b103f5..396aa7839231ffd0c739d0afad8419da06de8ab3 100644 (file)
@@ -105,6 +105,7 @@ sub serve_smart {
        $env{GIT_HTTP_EXPORT_ALL} = '1';
        $env{PATH_TRANSLATED} = "$git->{git_dir}/$path";
        my $rdr = input_prepare($env) or return r(500);
+       $rdr->{quiet} = 1;
        my $qsp = PublicInbox::Qspawn->new([qw(git http-backend)], \%env, $rdr);
        $qsp->psgi_yield($env, $limiter, \&ghb_parse_hdr, $env, $git, $path);
 }
index 6b7441b006ac19cd36204f14980f36e5d495642e..4c372569293e401db71770e12f6709c4350fd65d 100644 (file)
@@ -57,7 +57,8 @@ sub ver_check { # git->check_async callback
                my $qsp = PublicInbox::Qspawn->new(['git', @cfg,
                                "--git-dir=$ctx->{git}->{git_dir}", 'archive',
                                "--prefix=$ctx->{snap_pfx}/",
-                               "--format=$ctx->{snap_fmt}", $treeish]);
+                               "--format=$ctx->{snap_fmt}", $treeish], undef,
+                               { quiet => 1 });
                $qsp->psgi_yield($ctx->{env}, undef, \&archive_hdr, $ctx);
        }
 }