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 F397420711 for ; Wed, 6 Jul 2016 07:14:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 05/10] wwwstream: allow undef noop callback Date: Wed, 6 Jul 2016 07:14:30 +0000 Message-Id: <20160706071435.18143-6-e@80x24.org> In-Reply-To: <20160706071435.18143-1-e@80x24.org> References: <20160706071435.18143-1-e@80x24.org> List-Id: This can be use to specify a small response using -html_tip. --- lib/PublicInbox/WwwStream.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index 285416d..bce384b 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -9,9 +9,11 @@ use PublicInbox::Hval qw(ascii_html); use URI; use constant PI_URL => 'https://public-inbox.org/'; +sub close {} + sub new { my ($class, $ctx, $cb) = @_; - bless { nr => 0, cb => $cb, ctx => $ctx }, $class; + bless { nr => 0, cb => $cb || *close, ctx => $ctx }, $class; } sub response { @@ -99,6 +101,4 @@ sub getline { delete $self->{cb} ? _html_end($self) : undef; } -sub close {} - 1; -- EW