+ my $mm = $other->mm or return;
+
+ # try to find the URL with Msgmap to avoid forking
+ my $num = $mm->num_for($ctx->{mid});
+ if (defined $num) {
+ push @{$ctx->{found}}, $other;
+ } else {
+ # no point in trying the fork fallback if we
+ # know Xapian is up-to-date but missing the
+ # message in the current repo
+ push @{$ctx->{again}}, $other;
+ }
+}
+
+sub ext_msg_step {
+ my ($pi_cfg, $section, $ctx) = @_;
+ if (defined($section)) {
+ return if $section !~ m!\Apublicinbox\.([^/]+)\z!;
+ my $ibx = $pi_cfg->lookup_name($1) or return;
+ ext_msg_i($ibx, $ctx);
+ } else { # undef == "EOF"
+ finalize_exact($ctx);
+ }
+}
+
+sub ext_msg {
+ my ($ctx) = @_;
+ sub {
+ $ctx->{-wcb} = $_[0]; # HTTP server write callback
+
+ if ($ctx->{env}->{'pi-httpd.async'}) {
+ require PublicInbox::ConfigIter;
+ my $iter = PublicInbox::ConfigIter->new(
+ $ctx->{www}->{pi_config},
+ \&ext_msg_step, $ctx);
+ $iter->event_step;