* [PATCH 2/3] lei: use IO::Uncompress::Gunzip MultiStream
2021-03-29 7:08 6% [PATCH 0/3] lei input improvements Eric Wong
@ 2021-03-29 7:08 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-29 7:08 UTC (permalink / raw)
To: meta
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
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] lei input improvements
@ 2021-03-29 7:08 6% Eric Wong
2021-03-29 7:08 7% ` [PATCH 2/3] lei: use IO::Uncompress::Gunzip MultiStream Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-03-29 7:08 UTC (permalink / raw)
To: meta
These affect the convert, import, mark sub-commands.
Eric Wong (3):
lei_input: avoid special case sub for --stdin
lei: use IO::Uncompress::Gunzip MultiStream
lei_input: treat ".eml" and ".patch" suffix as "eml"
lib/PublicInbox/LeiConvert.pm | 1 -
lib/PublicInbox/LeiImport.pm | 1 -
lib/PublicInbox/LeiInput.pm | 33 +++++++++++++++++++--------------
lib/PublicInbox/LeiMark.pm | 1 -
lib/PublicInbox/LeiRemote.pm | 2 +-
lib/PublicInbox/LeiXSearch.pm | 2 +-
t/lei-import.t | 2 +-
t/lei-mark.t | 4 ++--
8 files changed, 24 insertions(+), 22 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-29 7:08 6% [PATCH 0/3] lei input improvements Eric Wong
2021-03-29 7:08 7% ` [PATCH 2/3] lei: use IO::Uncompress::Gunzip MultiStream Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).