From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 547C01F4B4 for ; Mon, 21 Dec 2020 19:41:21 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] manifest.js.gz: fix per-inbox /$INBOX/manifest.js.gz Date: Mon, 21 Dec 2020 19:41:21 +0000 Message-Id: <20201221194121.24139-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: /$INBOX/manifest.js.gz should not attempt to match every inbox in the domain (or every inbox); that is for /manifest.js.gz (without a /$INBOX prefix). Fixes: f303b4add8ea1883 ("wwwlisting: avoid hogging event loop") --- lib/PublicInbox/ManifestJsGz.pm | 7 +++++++ lib/PublicInbox/WWW.pm | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/ManifestJsGz.pm b/lib/PublicInbox/ManifestJsGz.pm index 6d5b57ee..e02450fa 100644 --- a/lib/PublicInbox/ManifestJsGz.pm +++ b/lib/PublicInbox/ManifestJsGz.pm @@ -99,4 +99,11 @@ sub psgi_triple { 'Content-Length', bytes::length($out) ], [ $out ] ] } +sub per_inbox { + my ($ctx) = @_; + # only one inbox, slow is probably OK + slow_manifest_add($ctx, $ctx->{ibx}); + psgi_triple($ctx); +} + 1; diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index a33d25ab..52630ae3 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -505,7 +505,7 @@ sub get_inbox_manifest ($$$) { my $r404 = invalid_inbox($ctx, $inbox); return $r404 if $r404; require PublicInbox::ManifestJsGz; - PublicInbox::ManifestJsGz->response($ctx); + PublicInbox::ManifestJsGz::per_inbox($ctx); } sub get_attach {