From ecad69406fffd47b34ec28bba0b1c9d7fb333c61 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 20 Jun 2016 00:57:12 +0000 Subject: feed: avoid needless method dispatches on 404 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(-) (limited to 'lib/PublicInbox/Feed.pm') diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 045e495f..d88421b0 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 { -- cgit v1.2.3-24-ge0c7