+sub eidx_manifest_add ($$$) {
+ my ($ctx, $ALL, $ibx) = @_;
+ if (my $data = $ALL->misc->inbox_data($ibx)) {
+ $data = $json->decode($data);
+ delete $data->{''}; # private
+ while (my ($url_path, $ent) = each %$data) {
+ inject_entry($ctx, $url_path, $ent);
+ }
+ } else {
+ warn "E: `${\$ibx->eidx_key}' not indexed by $ALL->{topdir}\n";
+ # do not use slow path for global manifest since
+ # it can become catastrophically slow. per-inbox manifest
+ # is not too bad with dozens of epochs, so never fail that:
+ slow_manifest_add($ctx, $ibx) if $ibx == $ctx->{ibx};
+ }
+}
+
+sub response {
+ my ($class, $ctx) = @_;
+ bless $ctx, $class;
+ my ($re, undef) = $ctx->url_filter;
+ $re // return psgi_triple($ctx);
+ my $iter = PublicInbox::ConfigIter->new($ctx->{www}->{pi_cfg},
+ $ctx->can('list_match_i'), $re, $ctx);
+ sub {
+ $ctx->{-wcb} = $_[0]; # HTTP server callback
+ $ctx->{env}->{'pi-httpd.async'} ?
+ $iter->event_step : $iter->each_section;
+ }
+}
+
+sub ibx_entry {
+ my ($ctx, $ibx) = @_;
+ my $ALL = $ctx->{www}->{pi_cfg}->ALL;
+ $ALL ? eidx_manifest_add($ctx, $ALL, $ibx) :
+ slow_manifest_add($ctx, $ibx);
+}
+
+sub hide_key { 'manifest' } # for WwwListing->list_match_i