1 # Copyright (C) all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # Main web interface for mailing list archives
6 # We focus on the lowest common denominators here:
7 # - targeted at text-only console browsers (w3m, links, etc..)
8 # - Only basic HTML, CSS only for line-wrapping <pre> text content for GUIs
9 # and diff/syntax-highlighting (optional)
10 # - No JavaScript, graphics or icons allowed.
11 # - Must not rely on static content
12 # - UTF-8 is only for user-content, 7-bit US-ASCII for us
13 package PublicInbox::WWW;
16 use PublicInbox::Config;
17 use PublicInbox::Hval;
18 use URI::Escape qw(uri_unescape);
19 use PublicInbox::MID qw(mid_escape);
20 use PublicInbox::GitHTTPBackend;
21 use PublicInbox::UserContent;
22 use PublicInbox::WwwStatic qw(r path_info_raw);
25 # TODO: consider a routing tree now that we have more endpoints:
26 our $INBOX_RE = qr!\A/([\w\-][\w\.\-\+]*)!;
27 our $MID_RE = qr!([^/]+)!;
28 our $END_RE = qr!(T/|t/|t\.mbox(?:\.gz)?|t\.atom|raw|)!;
29 our $ATTACH_RE = qr!([0-9][0-9\.]*)-($PublicInbox::Hval::FN)!;
30 our $OID_RE = qr![a-f0-9]{7,}!;
33 my ($class, $pi_cfg) = @_;
34 bless { pi_cfg => $pi_cfg // PublicInbox::Config->new }, $class;
37 # backwards compatibility, do not use
39 my ($req, $method) = @_;
40 PublicInbox::WWW->new->call($req->env);
44 my ($self, $env) = @_;
45 my $ctx = { env => $env, www => $self };
47 # we don't care about multi-value
51 my ($k, $v) = split(/=/, $_, 2);
52 # none of the keys we care about will need escaping
53 ($k // '', uri_unescape($v // ''))
54 } split(/[&;]+/, $env->{QUERY_STRING});
56 my $path_info = path_info_raw($env);
57 my $method = $env->{REQUEST_METHOD};
59 if ($method eq 'POST') {
60 if ($path_info =~ m!$INBOX_RE/(?:(?:git/)?([0-9]+)(?:\.git)?/)?
61 (git-upload-pack)\z!x) {
62 my ($epoch, $path) = ($2, $3);
63 return invalid_inbox($ctx, $1) ||
64 serve_git($ctx, $epoch, $path);
65 } elsif ($path_info =~ m!$INBOX_RE/(\w+)\.sql\.gz\z!o) {
66 return get_altid_dump($ctx, $1, $2);
67 } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/$ATTACH_RE\z!o) {
68 my ($idx, $fn) = ($3, $4);
69 return invalid_inbox_mid($ctx, $1, $2) ||
70 get_attach($ctx, $idx, $fn);
71 } elsif ($path_info =~ m!$INBOX_RE/!o) {
72 return invalid_inbox($ctx, $1) || mbox_results($ctx);
75 elsif ($method !~ /\A(?:GET|HEAD)\z/) {
79 # top-level indices and feeds
80 if ($path_info eq '/') {
81 require PublicInbox::WwwListing;
82 PublicInbox::WwwListing->response($ctx);
83 } elsif ($path_info eq '/manifest.js.gz') {
84 require PublicInbox::ManifestJsGz;
85 PublicInbox::ManifestJsGz->response($ctx);
86 } elsif ($path_info =~ m!$INBOX_RE\z!o) {
87 invalid_inbox($ctx, $1) || r301($ctx, $1);
88 } elsif ($path_info =~ m!$INBOX_RE(?:/|/index\.html)?\z!o) {
89 invalid_inbox($ctx, $1) || get_index($ctx);
90 } elsif ($path_info =~ m!$INBOX_RE/(?:atom\.xml|new\.atom)\z!o) {
91 invalid_inbox($ctx, $1) || get_atom($ctx);
92 } elsif ($path_info =~ m!$INBOX_RE/new\.html\z!o) {
93 invalid_inbox($ctx, $1) || get_new($ctx);
94 } elsif ($path_info =~ m!$INBOX_RE/description\z!o) {
95 get_description($ctx, $1);
96 } elsif ($path_info =~ m!$INBOX_RE/(?:(?:git/)?([0-9]+)(?:\.git)?/)?
97 ($PublicInbox::GitHTTPBackend::ANY)\z!ox) {
98 my ($epoch, $path) = ($2, $3);
99 invalid_inbox($ctx, $1) || serve_git($ctx, $epoch, $path);
100 } elsif ($path_info =~ m!$INBOX_RE/([a-zA-Z0-9_\-]+).mbox\.gz\z!o) {
101 serve_mbox_range($ctx, $1, $2);
102 } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/$END_RE\z!o) {
103 msg_page($ctx, $1, $2, $3);
105 } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/$ATTACH_RE\z!o) {
106 my ($idx, $fn) = ($3, $4);
107 invalid_inbox_mid($ctx, $1, $2) || get_attach($ctx, $idx, $fn);
108 # in case people leave off the trailing slash:
109 } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/(T|t)\z!o) {
110 my ($inbox, $mid_ue, $suffix) = ($1, $2, $3);
111 $suffix .= $suffix =~ /\A[tT]\z/ ? '/#u' : '/';
112 r301($ctx, $inbox, $mid_ue, $suffix);
114 } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/R/?\z!o) {
115 my ($inbox, $mid_ue) = ($1, $2);
116 r301($ctx, $inbox, $mid_ue, '#R');
118 } elsif ($path_info =~ m!$INBOX_RE/$MID_RE/f/?\z!o) {
120 } elsif ($path_info =~ m!$INBOX_RE/_/text(?:/(.*))?\z!o) {
121 get_text($ctx, $1, $2);
122 } elsif ($path_info =~ m!$INBOX_RE/([a-zA-Z0-9_\-\.]+)\.css\z!o) {
123 get_css($ctx, $1, $2);
124 } elsif ($path_info =~ m!$INBOX_RE/manifest\.js\.gz\z!o) {
125 get_inbox_manifest($ctx, $1, $2);
126 } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s/\z!o) {
127 get_vcs_object($ctx, $1, $2);
128 } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s/
129 ($PublicInbox::Hval::FN)\z!ox) {
130 get_vcs_object($ctx, $1, $2, $3);
131 } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s\z!o) {
132 r301($ctx, $1, $2, 's/');
133 } elsif ($path_info =~ m!$INBOX_RE/(\w+)\.sql\.gz\z!o) {
134 get_altid_dump($ctx, $1, $2);
135 # convenience redirects order matters
136 } elsif ($path_info =~ m!$INBOX_RE/([^/]{2,})\z!o) {
138 } elsif ($path_info =~ m!\A/\+/([a-zA-Z0-9_\-\.]+)\.css\z!) {
139 get_css($ctx, undef, $1); # for WwwListing
141 legacy_redirects($ctx, $path_info);
145 # for CoW-friendliness, MOOOOO! Even for single-process setups,
146 # we want to get all immortal allocations done early to avoid heap
147 # fragmentation since common allocators favor a large contiguous heap.
151 # populate caches used by Encode internally, since emails
152 # may show up with any encoding.
154 Encode::find_encoding($_) for Encode->encodings(':all');
156 require PublicInbox::ExtMsg;
157 require PublicInbox::Feed;
158 require PublicInbox::View;
159 require PublicInbox::SearchThread;
160 require PublicInbox::Eml;
161 require PublicInbox::Mbox;
162 require PublicInbox::ViewVCS;
163 require PublicInbox::WwwText;
164 require PublicInbox::WwwAttach;
166 require PublicInbox::Search;
167 PublicInbox::Search::load_xapian();
169 for (qw(SearchView MboxGz WwwAltId)) {
170 eval "require PublicInbox::$_;";
173 my $pi_cfg = $self->{pi_cfg};
174 if (defined($pi_cfg->{'publicinbox.cgitrc'})) {
175 $pi_cfg->limiter('-cgit');
177 $pi_cfg->ALL and require PublicInbox::Isearch;
179 $self->stylesheets_prepare($_) for ('', '../', '../../');
184 # private functions below
188 if ($ctx && $ctx->{mid}) {
189 require PublicInbox::ExtMsg;
190 return PublicInbox::ExtMsg::ext_msg($ctx);
195 sub news_cgit_fallback ($) {
197 my $www = $ctx->{www};
198 my $env = $ctx->{env};
199 my $res = $www->news_www->call($env);
200 $res = $www->cgit->call($env) if $res->[0] == 404;
201 $res = $www->coderepo->srv($ctx) if $res->[0] == 404;
205 # returns undef if valid, array ref response if invalid
206 sub invalid_inbox ($$) {
207 my ($ctx, $inbox) = @_;
208 my $ibx = $ctx->{www}->{pi_cfg}->lookup_name($inbox) //
209 $ctx->{www}->{pi_cfg}->lookup_ei($inbox);
215 # sometimes linkifiers (not ours!) screw up automatic link
216 # generation and link things intended for nntp:// to https?://,
217 # so try to infer links and redirect them to the appropriate
219 news_cgit_fallback($ctx);
222 # returns undef if valid, array ref response if invalid
223 sub invalid_inbox_mid {
224 my ($ctx, $inbox, $mid_ue) = @_;
225 my $ret = invalid_inbox($ctx, $inbox);
228 my $mid = $ctx->{mid} = uri_unescape($mid_ue);
229 my $ibx = $ctx->{ibx};
230 if ($mid =~ m!\A([a-f0-9]{2})([a-f0-9]{38})\z!) {
231 my ($x2, $x38) = ($1, $2);
232 # this is horrifically wasteful for legacy URLs:
233 my $str = $ctx->{ibx}->msg_by_path("$x2/$x38") or return;
234 my $s = PublicInbox::Eml->new($str);
235 $mid = PublicInbox::MID::mid_clean($s->header_raw('Message-ID'));
236 return r301($ctx, $inbox, mid_escape($mid));
241 # /$INBOX/new.atom -> Atom feed, includes replies
244 require PublicInbox::Feed;
245 PublicInbox::Feed::generate($ctx);
248 # /$INBOX/new.html -> HTML only
251 require PublicInbox::Feed;
252 PublicInbox::Feed::new_html($ctx);
255 # /$INBOX/?r=$GIT_COMMIT -> HTML only
258 require PublicInbox::Feed;
259 if ($ctx->{env}->{QUERY_STRING} =~ /(?:\A|[&;])q=/) {
260 require PublicInbox::SearchView;
261 PublicInbox::SearchView::sres_top_html($ctx);
263 PublicInbox::Feed::generate_html_index($ctx);
267 # /$INBOX/$MESSAGE_ID/raw -> raw mbox
270 require PublicInbox::Mbox;
271 PublicInbox::Mbox::emit_raw($ctx) || r(404);
274 # /$INBOX/$MESSAGE_ID/ -> HTML content (short quotes)
277 require PublicInbox::View;
278 PublicInbox::View::msg_page($ctx) || r404($ctx);
281 # /$INBOX/$MESSAGE_ID/t/
283 my ($ctx, $flat) = @_;
284 $ctx->{ibx}->over or return need($ctx, 'Overview');
285 $ctx->{flat} = $flat;
286 require PublicInbox::View;
287 PublicInbox::View::thread_html($ctx);
290 # /$INBOX/_/text/$KEY/
291 # /$INBOX/_/text/$KEY/raw
292 # KEY may contain slashes
294 my ($ctx, $inbox, $key) = @_;
295 my $r404 = invalid_inbox($ctx, $inbox);
296 return $r404 if $r404;
298 require PublicInbox::WwwText;
299 PublicInbox::WwwText::get_text($ctx, $key);
302 # show git objects (blobs and commits)
303 # /$INBOX/$GIT_OBJECT_ID/s/
304 # /$INBOX/$GIT_OBJECT_ID/s/$FILENAME
305 sub get_vcs_object ($$$;$) {
306 my ($ctx, $inbox, $oid, $filename) = @_;
307 my $r404 = invalid_inbox($ctx, $inbox);
308 return $r404 if $r404;
309 return r(404) if !$ctx->{www}->{pi_cfg}->repo_objs($ctx->{ibx});
310 require PublicInbox::ViewVCS;
311 PublicInbox::ViewVCS::show($ctx, $oid, $filename);
315 my ($ctx, $inbox, $altid_pfx) =@_;
316 my $r404 = invalid_inbox($ctx, $inbox);
317 return $r404 if $r404;
318 eval { require PublicInbox::WwwAltId } or return need($ctx, 'sqlite3');
319 PublicInbox::WwwAltId::sqldump($ctx, $altid_pfx);
323 my ($ctx, $extra) = @_;
324 require PublicInbox::WwwStream;
325 PublicInbox::WwwStream::html_oneshot($ctx, 501, <<EOF);
326 <pre>$extra is not available for this public-inbox
327 <a\nhref="../">Return to index</a></pre>
331 # /$INBOX/$MESSAGE_ID/t.mbox -> thread as mbox
332 # /$INBOX/$MESSAGE_ID/t.mbox.gz -> thread as gzipped mbox
333 # note: I'm not a big fan of other compression formats since they're
334 # significantly more expensive on CPU than gzip and less-widely available,
335 # especially on older systems. Stick to zlib since that's what git uses.
336 sub get_thread_mbox {
337 my ($ctx, $sfx) = @_;
338 my $over = $ctx->{ibx}->over or return need($ctx, 'Overview');
339 require PublicInbox::Mbox;
340 PublicInbox::Mbox::thread_mbox($ctx, $over, $sfx);
344 # /$INBOX/$MESSAGE_ID/t.atom -> thread as Atom feed
345 sub get_thread_atom {
347 $ctx->{ibx}->over or return need($ctx, 'Overview');
348 require PublicInbox::Feed;
349 PublicInbox::Feed::generate_thread_atom($ctx);
352 sub legacy_redirects {
353 my ($ctx, $path_info) = @_;
355 # single-message pages
356 if ($path_info =~ m!$INBOX_RE/m/(\S+)/\z!o) {
358 } elsif ($path_info =~ m!$INBOX_RE/m/(\S+)/raw\z!o) {
359 r301($ctx, $1, $2, 'raw');
361 } elsif ($path_info =~ m!$INBOX_RE/f/(\S+)/\z!o) {
365 } elsif ($path_info =~ m!$INBOX_RE/t/(\S+)/\z!o) {
366 r301($ctx, $1, $2, 't/#u');
368 } elsif ($path_info =~ m!$INBOX_RE/t/(\S+)/mbox(\.gz)?\z!o) {
369 r301($ctx, $1, $2, "t.mbox$3");
371 # even older legacy redirects
372 } elsif ($path_info =~ m!$INBOX_RE/m/(\S+)\.html\z!o) {
375 } elsif ($path_info =~ m!$INBOX_RE/t/(\S+)\.html\z!o) {
376 r301($ctx, $1, $2, 't/#u');
378 } elsif ($path_info =~ m!$INBOX_RE/f/(\S+)\.html\z!o) {
381 } elsif ($path_info =~ m!$INBOX_RE/(?:m|f)/(\S+)\.txt\z!o) {
382 r301($ctx, $1, $2, 'raw');
384 } elsif ($path_info =~ m!$INBOX_RE/t/(\S+)(\.mbox(?:\.gz)?)\z!o) {
385 r301($ctx, $1, $2, "t$3");
387 # legacy convenience redirects, order still matters
388 } elsif ($path_info =~ m!$INBOX_RE/m/(\S+)\z!o) {
390 } elsif ($path_info =~ m!$INBOX_RE/t/(\S+)\z!o) {
391 r301($ctx, $1, $2, 't/#u');
392 } elsif ($path_info =~ m!$INBOX_RE/f/(\S+)\z!o) {
395 # some Message-IDs have slashes in them and the HTTP server
396 # may try to be clever and unescape them :<
397 } elsif ($path_info =~ m!$INBOX_RE/(\S+/\S+)/$END_RE\z!o) {
398 msg_page($ctx, $1, $2, $3);
400 # in case people leave off the trailing slash:
401 } elsif ($path_info =~ m!$INBOX_RE/(\S+/\S+)/(T|t)\z!o) {
402 r301($ctx, $1, $2, $3 eq 't' ? 't/#u' : $3);
403 } elsif ($path_info =~ m!$INBOX_RE/(\S+/\S+)/f\z!o) {
406 news_cgit_fallback($ctx);
411 my ($ctx, $inbox, $mid_ue, $suffix) = @_;
412 my $ibx = $ctx->{ibx};
414 my $r404 = invalid_inbox($ctx, $inbox);
415 return $r404 if $r404;
418 my $url = $ibx->base_url($ctx->{env});
419 my $qs = $ctx->{env}->{QUERY_STRING};
420 if (defined $mid_ue) {
421 # common, and much nicer as '@' than '%40':
422 $mid_ue =~ s/%40/@/g;
423 $url .= $mid_ue . '/';
425 $url .= $suffix if (defined $suffix);
426 $url .= "?$qs" if $qs ne '';
429 [ Location => $url, 'Content-Type' => 'text/plain' ],
430 [ "Redirecting to $url\n" ] ]
434 my ($ctx, $inbox, $mid_ue, $e) = @_;
436 $ret = invalid_inbox_mid($ctx, $inbox, $mid_ue) and return $ret;
437 '' eq $e and return get_mid_html($ctx);
438 'T/' eq $e and return get_thread($ctx, 1);
439 't/' eq $e and return get_thread($ctx);
440 't.atom' eq $e and return get_thread_atom($ctx);
441 't.mbox' eq $e and return get_thread_mbox($ctx);
442 't.mbox.gz' eq $e and return get_thread_mbox($ctx, '.gz');
443 'raw' eq $e and return get_mid_txt($ctx);
445 # legacy, but no redirect for compatibility:
446 'f/' eq $e and return get_mid_html($ctx);
451 my ($ctx, $epoch, $path) = @_;
452 my $env = $ctx->{env};
453 my $ibx = $ctx->{ibx};
454 my $git = defined $epoch ? $ibx->git_epoch($epoch) : $ibx->git;
455 $git ? PublicInbox::GitHTTPBackend::serve($env, $git, $path) : r404();
460 if ($ctx->{env}->{QUERY_STRING} =~ /(?:\A|[&;])q=/) {
461 $ctx->{ibx}->isrch or return need($ctx, 'search');
462 require PublicInbox::SearchView;
463 return PublicInbox::SearchView::mbox_results($ctx);
468 sub serve_mbox_range {
469 my ($ctx, $inbox, $range) = @_;
470 invalid_inbox($ctx, $inbox) || eval {
471 require PublicInbox::Mbox;
472 PublicInbox::Mbox::emit_range($ctx, $range);
478 $self->{news_www} //= do {
479 require PublicInbox::NewsWWW;
480 PublicInbox::NewsWWW->new($self->{pi_cfg});
486 $self->{cgit} //= do {
487 my $pi_cfg = $self->{pi_cfg};
489 if (defined($pi_cfg->{'publicinbox.cgitrc'})) {
490 require PublicInbox::Cgit;
491 PublicInbox::Cgit->new($pi_cfg);
494 Plack::Util::inline_object(call => sub { r404() });
501 $self->{coderepo} //= do {
502 require PublicInbox::WwwCoderepo;
503 PublicInbox::WwwCoderepo->new($self->{pi_cfg});
507 # GET $INBOX/manifest.js.gz
508 sub get_inbox_manifest ($$$) {
509 my ($ctx, $inbox, $key) = @_;
510 my $r404 = invalid_inbox($ctx, $inbox);
511 return $r404 if $r404;
512 require PublicInbox::ManifestJsGz;
513 PublicInbox::ManifestJsGz::per_inbox($ctx);
517 my ($ctx, $idx, $fn) = @_;
518 require PublicInbox::WwwAttach;
519 PublicInbox::WwwAttach::get_attach($ctx, $idx, $fn);
522 # User-generated content (UGC) may have excessively long lines
523 # and screw up rendering on some browsers, so we use pre-wrap.
525 # We also force everything to the same scaled font-size because GUI
526 # browsers (tested both Firefox and surf (webkit)) uses a larger font
527 # for the Search <form> element than the rest of the page. Font size
528 # uniformity is important to people who rely on gigantic fonts.
529 # Finally, we use monospace to ensure the Search field and button
530 # has the same size and spacing as everything else which is
531 # <pre>-formatted anyways.
532 our $STYLE = 'pre{white-space:pre-wrap}*{font-size:100%;font-family:monospace}';
534 sub stylesheets_prepare ($$) {
535 my ($self, $upfx) = @_;
537 require CSS::Minifier;
538 sub { CSS::Minifier::minify(input => $_[0]) };
540 require CSS::Minifier::XS;
541 sub { CSS::Minifier::XS::minify($_[0]) };
545 my $stylesheets = $self->{pi_cfg}->{css} || [];
549 foreach my $s (@$stylesheets) {
552 foreach my $k (qw(media title href)) {
553 if (s/\s*$k='([^']+)'// || s/\s*$k=(\S+)//) {
558 if (defined $attr->{href}) {
562 my ($key) = (m!([^/]+?)(?:\.css)?\z!i);
563 if ($key !~ /\A[a-zA-Z0-9_\-\.]+\z/) {
564 warn "ignoring $fn, non-ASCII word character\n";
567 open(my $fh, '<', $fn) or do {
568 warn "failed to open $fn: $!\n";
572 my $local = do { local $/; <$fh> };
573 if ($local =~ /\S/) {
574 $ctime = sprintf('%x',(stat($fh))[10]);
575 $local = $mini->($local);
578 # do not let BOFHs override userContent.css:
579 if ($local =~ /!\s*important\b/i) {
580 warn "ignoring $fn since it uses `!important'\n";
584 $css_map->{$key} = $local;
585 $attr->{href} = "$upfx$key.css?$ctime";
586 if (defined($attr->{title})) {
588 } elsif (($attr->{media}||'screen') eq 'screen') {
589 $attr->{-inline} = $local;
595 my $buf = "<style>$STYLE";
597 my @ext; # for media=print and whatnot
598 foreach my $attr (@$links) {
599 if (defined(my $str = delete $attr->{-inline})) {
610 foreach my $attr (@$links) {
611 delete $attr->{-inline};
612 $buf .= "<link\ntype=text/css\nrel=stylesheet";
613 while (my ($k, $v) = each %$attr) {
614 $v = qq{"$v"} if $v =~ /[\s=]/;
619 $self->{"-style-$upfx"} = $buf;
621 $self->{-style_inline} = $buf;
623 $self->{-css_map} = $css_map;
626 # returns an HTML fragment with <style> or <link> tags in them
627 # Called by WwwStream by nearly every HTML page
629 my ($self, $upfx) = @_;
630 $self->{-style_inline} || $self->{"-style-$upfx"} || do {
631 stylesheets_prepare($self, $upfx);
632 $self->{-style_inline} || $self->{"-style-$upfx"}
636 # /$INBOX/$KEY.css and /+/$KEY.css endpoints
637 # CSS is configured globally for all inboxes, but we access them on
638 # a per-inbox basis. This allows administrators to setup per-inbox
639 # static routes to intercept the request before it hits PSGI
640 # inbox == undef => top-level WwwListing
642 my ($ctx, $inbox, $key) = @_;
643 my $r404 = defined($inbox) ? invalid_inbox($ctx, $inbox) : undef;
644 return $r404 if $r404;
645 my $self = $ctx->{www};
646 my $css_map = $self->{-css_map} ||
647 stylesheets_prepare($self, defined($inbox) ? '' : '+/');
648 my $css = $css_map->{$key};
649 if (!defined($css) && defined($inbox) && $key eq 'userContent') {
650 my $env = $ctx->{env};
651 $css = PublicInbox::UserContent::sample($ctx->{ibx}, $env);
653 defined $css or return r404();
654 my $h = [ 'Content-Length', length($css), 'Content-Type', 'text/css' ];
655 PublicInbox::GitHTTPBackend::cache_one_year($h);
656 [ 200, $h, [ $css ] ];
659 sub get_description {
660 my ($ctx, $inbox) = @_;
661 invalid_inbox($ctx, $inbox) || do {
662 my $d = $ctx->{ibx}->description . "\n";
664 [ 200, [ 'Content-Length', length($d),
665 'Content-Type', 'text/plain' ], [ $d ] ];
669 sub event_step { # called via requeue
671 # gzf = PublicInbox::GzipFilter == $ctx
672 my $gzf = shift(@{$self->{-low_prio_q}}) // return;
673 PublicInbox::DS::requeue($self) if scalar(@{$self->{-low_prio_q}});
674 my $http = $gzf->{env}->{'psgix.io'}; # PublicInbox::HTTP
675 $http->next_step($gzf->can('async_next'));