]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: use IO::Uncompress::Gunzip MultiStream
authorEric Wong <e@80x24.org>
Mon, 29 Mar 2021 07:08:24 +0000 (07:08 +0000)
committerEric Wong <e@80x24.org>
Mon, 29 Mar 2021 17:43:54 +0000 (13:43 -0400)
This is compatible with default gunzip(1) behavior and
future-proofs us against potential changes in PublicInbox::WWW
to save memory on public-inbox-httpd instances.

lib/PublicInbox/LeiRemote.pm
lib/PublicInbox/LeiXSearch.pm

index 399fc9362c4792521b143bba5c3c64a1b0b3f45c..945d9990a535e7bb4a6c2b6d41ce40f99055b583 100644 (file)
@@ -50,7 +50,7 @@ sub mset {
        my ($fh, $pid) = popen_rd($cmd, undef, $rdr);
        my $reap = PublicInbox::OnDestroy->new($lei->can('sigint_reap'), $pid);
        $self->{smsg} = [];
-       $fh = IO::Uncompress::Gunzip->new($fh);
+       $fh = IO::Uncompress::Gunzip->new($fh, MultiStream => 1);
        PublicInbox::MboxReader->mboxrd($fh, \&_each_mboxrd_eml, $self);
        my $err = waitpid($pid, 0) == $pid ? undef
                                        : "BUG: waitpid($cmd): $!";
index 1a194f1c9dd9d45285e21bba796a0feb33095cc2..f3b8cc25f912c7571c65cb22c5fcb85d2345057c 100644 (file)
@@ -272,7 +272,7 @@ sub query_remote_mboxrd {
                $lei->qerr("# $cmd");
                my ($fh, $pid) = popen_rd($cmd, undef, $rdr);
                $reap_curl = PublicInbox::OnDestroy->new($sigint_reap, $pid);
-               $fh = IO::Uncompress::Gunzip->new($fh);
+               $fh = IO::Uncompress::Gunzip->new($fh, MultiStream => 1);
                PublicInbox::MboxReader->mboxrd($fh, \&each_remote_eml, $self,
                                                $lei, $each_smsg);
                my $err = waitpid($pid, 0) == $pid ? undef