From 7e782e8ff3ec64500913069a2efb5815fe711a36 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 1 Jun 2020 10:06:52 +0000 Subject: www: remove smsg_mime API and adjust callers To further simplify callers and avoid embarrasing memory explosions[1], we can finally eliminate this method in favor of smsg_eml. [1] commit 7d02b9e64455831d3bda20cd2e64e0c15dc07df5 ("view: stop storing all MIME objects on large threads") fixed a huge memory blowup. --- lib/PublicInbox/Inbox.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 38abdfe5..af034358 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -326,18 +326,12 @@ sub msg_by_smsg ($$) { git($self)->cat_file($blob); } -sub smsg_mime { - my ($self, $smsg) = @_; - if (my $s = msg_by_smsg($self, $smsg)) { - $smsg->{mime} = PublicInbox::Eml->new($s); - return $smsg; - } -} - sub smsg_eml { my ($self, $smsg) = @_; my $bref = msg_by_smsg($self, $smsg) or return; - PublicInbox::Eml->new($bref); + my $eml = PublicInbox::Eml->new($bref); + $smsg->populate($eml) unless exists($smsg->{num}); # v1 w/o SQLite + $eml; } sub mid2num($$) { -- cgit v1.2.3-24-ge0c7