From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0458B1F9FF for ; Mon, 29 Mar 2021 07:08:26 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] lei: use IO::Uncompress::Gunzip MultiStream Date: Mon, 29 Mar 2021 07:08:24 +0000 Message-Id: <20210329070825.14798-3-e@80x24.org> In-Reply-To: <20210329070825.14798-1-e@80x24.org> References: <20210329070825.14798-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 2 +- lib/PublicInbox/LeiXSearch.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiRemote.pm b/lib/PublicInbox/LeiRemote.pm index 399fc936..945d9990 100644 --- a/lib/PublicInbox/LeiRemote.pm +++ b/lib/PublicInbox/LeiRemote.pm @@ -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): $!"; diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 1a194f1c..f3b8cc25 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -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