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,AWL,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 5A76C2018C for ; Mon, 20 Jun 2016 00:57:19 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/7] feed: avoid needless method dispatches on 404 Date: Mon, 20 Jun 2016 00:57:12 +0000 Message-Id: <20160620005717.1482-3-e@80x24.org> In-Reply-To: <20160620005717.1482-1-e@80x24.org> References: <20160620005717.1482-1-e@80x24.org> List-Id: We overuse streaming, here. Allow Content-Length to be calculated in this case. --- lib/PublicInbox/Feed.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 045e495..d88421b 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -79,9 +79,8 @@ sub emit_atom { sub _no_thread { my ($cb) = @_; - my $fh = $cb->([404, ['Content-Type' => 'text/plain']]); - $fh->write("No feed found for thread\n"); - $fh->close; + $cb->([404, ['Content-Type', 'text/plain'], + ["No feed found for thread\n"]]); } sub end_feed {