diff options
author | Eric Wong <e@yhbt.net> | 2020-03-21 02:03:47 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-03-25 01:48:35 +0000 |
commit | d27de5b3df43f41c4e8f3b1cbad79b2436d2a549 (patch) | |
tree | b07af2127702cc50897341ca8e83efa917e06fb9 /lib/PublicInbox/WwwStream.pm | |
parent | 433f6127f648e83b8f12d7b232ff726a34a85beb (diff) | |
download | public-inbox-d27de5b3df43f41c4e8f3b1cbad79b2436d2a549.tar.gz |
No reason to use the ->getline interface for small responses.
Diffstat (limited to 'lib/PublicInbox/WwwStream.pm')
-rw-r--r-- | lib/PublicInbox/WwwStream.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index 2dd8b157..fceef745 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -28,7 +28,7 @@ sub new { bless { nr => 0, - cb => $cb || \&close, + cb => $cb, ctx => $ctx, base_url => base_url($ctx), }, $class; @@ -175,8 +175,9 @@ sub oneshot { ctx => $ctx, base_url => base_url($ctx), }, __PACKAGE__; - [ $code, [ 'Content-Type', 'text/html; charset=UTF-8' ], - [ _html_top($self), $$strref, _html_end($self) ] ] + [ $code, [ 'Content-Type', 'text/html; charset=UTF-8' ], [ + _html_top($self), $strref ? $$strref : (), _html_end($self) + ] ] } 1; |