From 9ab83286f8cff42fb3657dda2cd8a86fb068a59c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 11 Sep 2024 21:25:49 +0000 Subject: [PATCH] www: preload all inboxes if using ->ALL This ought to improve memory layout and ensure the regexp for address => inbox linkification works when hitting /$EXTINBOX/$MSGID/ links first (instead of /$INBOX/$MSGID) This fill_all call is redundant for cindex users who get the preload anyways, but necessary for non-cindex users. This should also avoid the broken/empty regexps problem described in 3b51fcc196e3 (view: fix addr2url mapping corruption, 2024-09-06) Fixes: 48cbe0c3c8dc4d26 (www: linkify inbox addresses in To/Cc headers, 2024-01-09) Reported-by: Konstantin Ryabitsev Link: https://public-inbox.org/meta/20240910-strong-rainbow-warthog-d6fe69@lemur/ Tested-by: Konstantin Ryabitsev --- lib/PublicInbox/WWW.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 289599b8c..1bc2966d3 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -187,7 +187,10 @@ sub preload { if (defined($pi_cfg->{'publicinbox.cgitrc'})) { $pi_cfg->limiter('-cgit'); } - $pi_cfg->ALL and require PublicInbox::Isearch; + if ($pi_cfg->ALL) { + require PublicInbox::Isearch; + $pi_cfg->fill_all; + } $self->cgit; $self->coderepo; $self->stylesheets_prepare($_) for ('', '../', '../../'); -- 2.47.2