From: Eric Wong Date: Mon, 20 Jun 2016 00:57:12 +0000 (+0000) Subject: feed: avoid needless method dispatches on 404 X-Git-Tag: v1.0.0~401 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ecad69406fffd47b34ec28bba0b1c9d7fb333c61;hp=4b9ab5255a2ce9e0f75a80afc731a96b760e9816;p=public-inbox.git feed: avoid needless method dispatches on 404 We overuse streaming, here. Allow Content-Length to be calculated in this case. --- 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 {