about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-29 09:26:33 +0000
committerEric Wong <e@80x24.org>2022-08-29 19:05:44 +0000
commit95a3cace67ff5297e6fc35972e401b7cb17ee310 (patch)
tree59c76a0e3c8d54ae2536e530fd8da4ca3b497dc8 /lib/PublicInbox/WwwStream.pm
parent7dafd481c3e4252447b6b7cf4f4a8d4620d1cc10 (diff)
downloadpublic-inbox-95a3cace67ff5297e6fc35972e401b7cb17ee310.tar.gz
Another step towards making our internal APIs more writev-like
and reducing the copies needed for `join' or `.=' concatenation.
Diffstat (limited to 'lib/PublicInbox/WwwStream.pm')
-rw-r--r--lib/PublicInbox/WwwStream.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index ab006c40..f2777fdc 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -164,8 +164,8 @@ sub getline {
         $ctx->zflush(_html_end($ctx));
 }
 
-sub html_oneshot ($$;$) {
-        my ($ctx, $code, $sref) = @_;
+sub html_oneshot ($$;@) {
+        my ($ctx, $code) = @_[0, 1];
         my $res_hdr = [ 'Content-Type' => 'text/html; charset=UTF-8',
                 'Content-Length' => undef ];
         bless $ctx, __PACKAGE__;
@@ -174,8 +174,7 @@ sub html_oneshot ($$;$) {
                 $ctx->zmore(html_top($ctx));
                 $ctx->{base_url} = base_url($ctx);
         };
-        $ctx->zmore($$sref) if $sref;
-        my $bdy = $ctx->zflush(_html_end($ctx));
+        my $bdy = $ctx->zflush(@_[2..$#_], _html_end($ctx));
         $res_hdr->[3] = length($bdy);
         [ $code, $res_hdr, [ $bdy ] ]
 }