From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CE5A21F42D; Wed, 18 Apr 2018 09:13:18 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Cc: "Eric Wong (Contractor, The Linux Foundation)" Subject: [PATCH 01/12] feed: respect feedmax, again Date: Wed, 18 Apr 2018 09:13:05 +0000 Message-Id: <20180418091316.29114-2-e@80x24.org> In-Reply-To: <20180418091316.29114-1-e@80x24.org> References: <20180418091316.29114-1-e@80x24.org> List-Id: Gigantic feeds probably make some clients unhappy, clamp it to what it was in the past. Fixes: b9534449ecce2c59 ("view: avoid offset during pagination") --- lib/PublicInbox/Feed.pm | 2 +- lib/PublicInbox/View.pm | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 5cb044b..d7df07e 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -95,7 +95,7 @@ sub recent_msgs { die "BUG: unsupported inbox version: $v\n"; } if (my $srch = $ibx->search) { - return PublicInbox::View::paginate_recent($ctx); + return PublicInbox::View::paginate_recent($ctx, $max); } my $hex = '[a-f0-9]'; diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 94058ed..af287b9 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -1049,10 +1049,9 @@ sub index_nav { # callback for WwwStream pagination_footer($ctx, '.') } -sub paginate_recent ($) { - my ($ctx) = @_; +sub paginate_recent ($$) { + my ($ctx, $lim) = @_; my $t = $ctx->{qp}->{t} || ''; - my $lim = 200; # this is our window my $opts = { limit => $lim }; my ($after, $before); @@ -1094,7 +1093,7 @@ sub paginate_recent ($) { sub index_topics { my ($ctx) = @_; - my $msgs = paginate_recent($ctx); + my $msgs = paginate_recent($ctx, 200); # 200 is our window if (@$msgs) { walk_thread(thread_results($ctx, $msgs), $ctx, *acc_topic); } -- EW