diff options
author | Eric Wong <e@80x24.org> | 2024-03-08 21:05:03 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-03-10 21:35:59 +0000 |
commit | 003829cdaa583d66c5af7564296d266952e0f12f (patch) | |
tree | 10b5fdb5f0c4ea88a21e41ebaafffdf29d95cae5 /lib/PublicInbox/OverIdx.pm | |
parent | 84ed7ec1c88721c25955d61f5904250fb07d7af6 (diff) | |
download | public-inbox-003829cdaa583d66c5af7564296d266952e0f12f.tar.gz |
Noticed while tracking down fast-import crash bug report. Link: https://public-inbox.org/meta/CAL_JsqK7P4gjLPyvzxNEcYmxT4j6Ah5f3Pz1RqDHxmysTg3aEg@mail.gmail.com/
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r-- | lib/PublicInbox/OverIdx.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index c9c25828..4f8533f7 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -17,6 +17,7 @@ use PublicInbox::MID qw/id_compress mids_for_index references/; use PublicInbox::Smsg qw(subject_normalized); use Compress::Zlib qw(compress); use Carp qw(croak); +use bytes (); # length sub dbh_new { my ($self) = @_; @@ -263,7 +264,10 @@ sub ddd_for ($) { sub add_overview { my ($self, $eml, $smsg) = @_; - $smsg->{lines} = $eml->body_raw =~ tr!\n!\n!; + my $raw = $eml->body_raw; + $smsg->{lines} = $raw =~ tr!\n!\n!; + $smsg->{bytes} //= bytes::length $raw; + undef $raw; my $mids = mids_for_index($eml); my $refs = $smsg->parse_references($eml, $mids); $mids->[0] //= do { |