my ($eml, $self) = @_;
my $lei = $self->{lei};
my $xoids = $lei->{ale}->xoids_for($eml, 1);
+ my $smsg = bless {}, 'PublicInbox::Smsg';
if ($lei->{sto} && !$xoids) { # memoize locally
- $lei->{sto}->ipc_do('add_eml', $eml);
+ my $res = $lei->{sto}->ipc_do('add_eml', $eml);
+ $smsg = $res if ref($res) eq ref($smsg);
}
- my $smsg = bless {}, 'PublicInbox::Smsg';
- $smsg->{blob} = $xoids ? (keys(%$xoids))[0]
- : git_sha(1, $eml)->hexdigest;
+ $smsg->{blob} //= $xoids ? (keys(%$xoids))[0]
+ : $lei->git_blob_id($eml);
$smsg->populate($eml);
$smsg->{mid} //= '(none)';
push @{$self->{smsg}}, $smsg;
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): $!";